The Free Software Media System - Server Backend & API
update interlaced detection
Luke Pulverenti51df0b79f208
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.csindex ba0790bf3b..2a3a416ad3 100644--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs@@ -292,16 +292,25 @@ namespace MediaBrowser.MediaEncoding.Encoderreturn false;}- // If the video codec is not some form of mpeg, then take a shortcut and limit this to containers that are likely to have interlaced content- if ((videoStream.Codec ?? string.Empty).IndexOf("mpeg", StringComparison.OrdinalIgnoreCase) == -1)+ var formats = (video.Container ?? string.Empty).Split(',').ToList();+ var enableInterlacedDection = formats.Contains("vob", StringComparer.OrdinalIgnoreCase) &&+ formats.Contains("m2ts", StringComparer.OrdinalIgnoreCase) &&+ formats.Contains("ts", StringComparer.OrdinalIgnoreCase) &&+ formats.Contains("mpegts", StringComparer.OrdinalIgnoreCase) &&+ formats.Contains("wtv", StringComparer.OrdinalIgnoreCase);++ // If it's mpeg based, assume true+ if ((videoStream.Codec ?? string.Empty).IndexOf("mpeg", StringComparison.OrdinalIgnoreCase) != -1){- var formats = (video.Container ?? string.Empty).Split(',').ToList();-- if (!formats.Contains("vob", StringComparer.OrdinalIgnoreCase) &&- !formats.Contains("m2ts", StringComparer.OrdinalIgnoreCase) &&- !formats.Contains("ts", StringComparer.OrdinalIgnoreCase) &&- !formats.Contains("mpegts", StringComparer.OrdinalIgnoreCase) &&- !formats.Contains("wtv", StringComparer.OrdinalIgnoreCase))+ if (enableInterlacedDection)+ {+ return true;+ }+ }+ else+ {+ // If the video codec is not some form of mpeg, then take a shortcut and limit this to containers that are likely to have interlaced content+ if (!enableInterlacedDection){return false;}