diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-09-21 17:37:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-21 17:37:31 -0400 |
| commit | 8586c9f6a7dc8562da1f6bca2b3ce53398dd03b5 (patch) | |
| tree | 6292159c4b83abb76c243b2ff64c1278d0b2ae18 /MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs | |
| parent | 81843431a4a5763ccf8af7165f4876b203ca24f5 (diff) | |
| parent | e5f340d6b7c914428e6b68ec1bbfeb9e27234b32 (diff) | |
Merge pull request #2905 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index e76217fda..fb8aa9767 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -160,7 +160,26 @@ namespace MediaBrowser.Controller.MediaEncoding public int? OutputAudioBitrate; public int? OutputAudioChannels; - public bool DeInterlace { get; set; } + + public bool DeInterlace(string videoCodec) + { + // Support general param + if (BaseRequest.DeInterlace) + { + return true; + } + + if (!string.IsNullOrWhiteSpace(videoCodec)) + { + if (string.Equals(BaseRequest.GetOption(videoCodec, "deinterlace"), "true", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + + return false; + } + public bool IsVideoRequest { get; set; } public TranscodingJobType TranscodingType { get; set; } @@ -435,6 +454,28 @@ namespace MediaBrowser.Controller.MediaEncoding } } + public string ActualOutputVideoCodec + { + get + { + var codec = OutputVideoCodec; + + if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) + { + var stream = VideoStream; + + if (stream != null) + { + return stream.Codec; + } + + return null; + } + + return codec; + } + } + public bool? IsTargetInterlaced { get @@ -444,7 +485,7 @@ namespace MediaBrowser.Controller.MediaEncoding return VideoStream == null ? (bool?)null : VideoStream.IsInterlaced; } - if (DeInterlace) + if (DeInterlace(ActualOutputVideoCodec)) { return false; } |
