diff options
| author | KerryJ <kerry@iodrive.co.za> | 2019-10-17 11:31:11 +0200 |
|---|---|---|
| committer | KerryJ <kerry@iodrive.co.za> | 2019-10-17 11:31:11 +0200 |
| commit | ef3df7baaf81dd509278505d38eae199209cd635 (patch) | |
| tree | 216252fb66895041b94e35969e45c2812ab42a8f /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | d8c3b26fa686e440912a45d82bb9866b4b66822c (diff) | |
Fix System.NullReferenceException when playing Dvds copied to HDD
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 991fc0b00..d896a7aef 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1173,17 +1173,17 @@ namespace MediaBrowser.Controller.MediaEncoding { bitrate = GetMinBitrate(videoStream.BitRate.Value, bitrate.Value); } - } - - if (bitrate.HasValue) - { - var inputVideoCodec = videoStream.Codec; - bitrate = ScaleBitrate(bitrate.Value, inputVideoCodec, outputVideoCodec); - // If a max bitrate was requested, don't let the scaled bitrate exceed it - if (request.VideoBitRate.HasValue) + if (bitrate.HasValue) { - bitrate = Math.Min(bitrate.Value, request.VideoBitRate.Value); + var inputVideoCodec = videoStream.Codec; + bitrate = ScaleBitrate(bitrate.Value, inputVideoCodec, outputVideoCodec); + + // If a max bitrate was requested, don't let the scaled bitrate exceed it + if (request.VideoBitRate.HasValue) + { + bitrate = Math.Min(bitrate.Value, request.VideoBitRate.Value); + } } } |
