Browse Source

exception was falling through

Michael Hoskins 5 years ago
parent
commit
765df09cc3
1 changed files with 4 additions and 4 deletions
  1. 4 4
      MovieBarcodeGenerator/SharpFF.cs

+ 4 - 4
MovieBarcodeGenerator/SharpFF.cs

@@ -13,8 +13,8 @@ namespace MovieBarcodeGenerator {
         private static log4net.ILog log = log4net.LogManager.GetLogger("SharpFF");
 
         public static void ExecuteCommand(string parameters) {
-            if (String.IsNullOrEmpty(ffmpegPath)) {
-                log.ErrorFormat("FFmpeg was not found at '{0}'.", ffmpegPath);
+            if (String.IsNullOrEmpty(ffmpegPath) || !File.Exists(Path.Combine(ffmpegPath, "ffmpeg.exe"))) {
+                log.FatalFormat("FFmpeg was not found at '{0}'.", ffmpegPath);
                 throw new Exception("Path to ffmpeg not specified. Set ffmpeg path (excluding exe) before attempting to use SharpFF.");
             }
             Process p = new Process();
@@ -28,8 +28,8 @@ namespace MovieBarcodeGenerator {
         }
 
         public static decimal GetDuration(string videoPath) {
-            if (String.IsNullOrEmpty(ffmpegPath)) {
-                log.ErrorFormat("FFmpeg was not found at '{0}'.", ffmpegPath);
+            if (String.IsNullOrEmpty(ffmpegPath) || !File.Exists(Path.Combine(ffmpegPath, "ffmpeg.exe"))) {
+                log.FatalFormat("FFmpeg was not found at '{0}'.", ffmpegPath);
                 throw new Exception("Path to ffmpeg not specified. Set ffmpeg path (excluding exe) before attempting to use SharpFF.");
             }
             Process p = new Process();