diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-09-29 16:16:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-29 16:16:58 -0400 |
| commit | e183a1493312f3bacce50925a06844d63a866217 (patch) | |
| tree | 0133b0f1d4882fe00951c64d782dc15cb2b27921 /MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | |
| parent | d64005df40c535b3495d61b3f3319adae38f2d26 (diff) | |
| parent | 3e1aab6b29621db741ecfb469189322c907b673f (diff) | |
Merge pull request #1814 from Bond-009/ffmpeg_fix
Fix ffmpeg version check for unknown versions
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index da0b7693e..3620abfee 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -118,15 +118,18 @@ namespace MediaBrowser.MediaEncoding.Encoder _logger.LogInformation("Found ffmpeg version {0}", version != null ? version.ToString() : "unknown"); - if (version == null && MinVersion != null && MaxVersion != null) // Version is unknown + if (version == null) { - if (MinVersion == MaxVersion) + if (MinVersion != null && MaxVersion != null) // Version is unknown { - _logger.LogWarning("FFmpeg validation: We recommend ffmpeg version {0}", MinVersion); - } - else - { - _logger.LogWarning("FFmpeg validation: We recommend a minimum of {0} and maximum of {1}", MinVersion, MaxVersion); + if (MinVersion == MaxVersion) + { + _logger.LogWarning("FFmpeg validation: We recommend ffmpeg version {0}", MinVersion); + } + else + { + _logger.LogWarning("FFmpeg validation: We recommend a minimum of {0} and maximum of {1}", MinVersion, MaxVersion); + } } return false; @@ -161,7 +164,7 @@ namespace MediaBrowser.MediaEncoding.Encoder internal static Version GetFFmpegVersion(string output) { // For pre-built binaries the FFmpeg version should be mentioned at the very start of the output - var match = Regex.Match(output, @"ffmpeg version ((?:\d+\.?)+)"); + var match = Regex.Match(output, @"^ffmpeg version n?((?:\d+\.?)+)"); if (match.Success) { |
