aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-09-28 18:08:38 -0400
committerGitHub <noreply@github.com>2019-09-28 18:08:38 -0400
commit3249fbb7159aaaa6ecb54398e81800b0c3a5e77f (patch)
treea380d54ac600d51773e883cd4833a6cca1c1f0c5 /MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
parent2d797adc0844bcb054cac3216cb2f9015c754615 (diff)
parent05a1510b31ac43fa0a4dec6c1b3a87667984c707 (diff)
Merge pull request #1804 from Bond-009/ffmpeg_tests
Add tests for EncoderValidator and add support for ffmpeg 4.2
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs21
1 files changed, 11 insertions, 10 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 75bb960c3..04ff66991 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -114,13 +114,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
FFprobePath = Regex.Replace(FFmpegPath, @"[^\/\\]+?(\.[^\/\\\n.]+)?$", @"ffprobe$1");
// Interrogate to understand what coders are supported
- var result = new EncoderValidator(_logger, _processFactory).GetAvailableCoders(FFmpegPath);
+ var validator = new EncoderValidator(_logger, FFmpegPath);
- SetAvailableDecoders(result.decoders);
- SetAvailableEncoders(result.encoders);
+ SetAvailableDecoders(validator.GetDecoders());
+ SetAvailableEncoders(validator.GetEncoders());
}
- _logger.LogInformation("FFmpeg: {0}: {1}", EncoderLocation.ToString(), FFmpegPath ?? string.Empty);
+ _logger.LogInformation("FFmpeg: {0}: {1}", EncoderLocation, FFmpegPath ?? string.Empty);
}
/// <summary>
@@ -183,11 +183,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
if (File.Exists(path))
{
- rc = new EncoderValidator(_logger, _processFactory).ValidateVersion(path, true);
+ rc = new EncoderValidator(_logger, path).ValidateVersion();
if (!rc)
{
- _logger.LogWarning("FFmpeg: {0}: Failed version check: {1}", location.ToString(), path);
+ _logger.LogWarning("FFmpeg: {0}: Failed version check: {1}", location, path);
}
// ToDo - Enable the ffmpeg validator. At the moment any version can be used.
@@ -198,7 +198,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
}
else
{
- _logger.LogWarning("FFmpeg: {0}: File not found: {1}", location.ToString(), path);
+ _logger.LogWarning("FFmpeg: {0}: File not found: {1}", location, path);
}
}
@@ -228,9 +228,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
- private string ExistsOnSystemPath(string filename)
+ private string ExistsOnSystemPath(string fileName)
{
- string inJellyfinPath = GetEncoderPathFromDirectory(System.AppContext.BaseDirectory, filename);
+ string inJellyfinPath = GetEncoderPathFromDirectory(System.AppContext.BaseDirectory, fileName);
if (!string.IsNullOrEmpty(inJellyfinPath))
{
return inJellyfinPath;
@@ -239,13 +239,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
foreach (var path in values.Split(Path.PathSeparator))
{
- var candidatePath = GetEncoderPathFromDirectory(path, filename);
+ var candidatePath = GetEncoderPathFromDirectory(path, fileName);
if (!string.IsNullOrEmpty(candidatePath))
{
return candidatePath;
}
}
+
return null;
}