aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNyanmisaka <nst799610810@gmail.com>2020-11-28 22:32:54 +0800
committerGitHub <noreply@github.com>2020-11-28 22:32:54 +0800
commit0c6efe6317d1682ba71b751686360124eda41de9 (patch)
tree19309733092edd81ae11095adbc9997ec41c935f
parentd72f3498bf2c53be0dfb900feba58d84efbffde0 (diff)
Apply suggestions from code review
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index cb162f0d4..8d83096fb 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -555,13 +555,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
// Use ffmpeg to sample 100 (we can drop this if required using thumbnail=50 for 50 frames) frames and pick the best thumbnail. Have a fall back just in case.
var enableThumbnail = useIFrame && !string.Equals("wtv", container, StringComparison.OrdinalIgnoreCase);
- if (string.IsNullOrEmpty(vf))
+ if (enableThumbnail)
{
- vf = enableThumbnail ? "-vf thumbnail=24" : string.Empty;
- }
- else
- {
- vf += enableThumbnail ? ",thumbnail=24" : string.Empty;
+ if (string.IsNullOrEmpty(vf))
+ {
+ vf = "-vf thumbnail=24";
+ }
+ else
+ {
+ vf += ",thumbnail=24";
+ }
}
var args = string.Format(CultureInfo.InvariantCulture, "-i {0}{3} -threads {4} -v quiet -vframes 1 {2} -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, threads);