diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-10-20 17:10:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-20 17:10:43 +0200 |
| commit | fdb0c3a1dff0c1e9c3c22a3be688b97ea0bd7a6d (patch) | |
| tree | ed68f48f31978110b4536f9e73a9c5d6f20e890c | |
| parent | e3f1f62a8bb5377c80e3c26331915db7e0fe2fa4 (diff) | |
| parent | ef3df7baaf81dd509278505d38eae199209cd635 (diff) | |
Merge pull request #1909 from KerryRJ/FixDvdsFailingToPlay
Fix System.NullReferenceException when playing Dvds copied to HDD
| -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); + } } } |
