瀏覽代碼

Merge pull request #6589 from Bond-009/ffmpeg3

Claus Vium 3 年之前
父節點
當前提交
46701e16b5
共有 1 個文件被更改,包括 14 次插入6 次删除
  1. 14 6
      MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

+ 14 - 6
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -165,14 +165,22 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 // User had cleared the custom path in UI
                 newPath = string.Empty;
             }
-            else if (Directory.Exists(path))
-            {
-                // Given path is directory, so resolve down to filename
-                newPath = GetEncoderPathFromDirectory(path, "ffmpeg");
-            }
             else
             {
-                newPath = path;
+                if (Directory.Exists(path))
+                {
+                    // Given path is directory, so resolve down to filename
+                    newPath = GetEncoderPathFromDirectory(path, "ffmpeg");
+                }
+                else
+                {
+                    newPath = path;
+                }
+
+                if (!new EncoderValidator(_logger, newPath).ValidateVersion())
+                {
+                    throw new ResourceNotFoundException();
+                }
             }
 
             // Write the new ffmpeg path to the xml as <EncoderAppPath>