diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-10-20 17:10:43 +0200 |
|---|---|---|
| committer | Joshua Boniface <joshua@boniface.me> | 2019-10-20 14:22:13 -0400 |
| commit | 86a50367b2a72f97450dc6fba4af4c0ec9984a55 (patch) | |
| tree | cf563587d753e70a7580e9772b9d86d378eb5d3e | |
| parent | 0212c0b85ffffbc62b475f14901f4242c4a108d2 (diff) | |
Merge pull request #1909 from KerryRJ/FixDvdsFailingToPlay
Fix System.NullReferenceException when playing Dvds copied to HDD
(cherry picked from commit fdb0c3a1dff0c1e9c3c22a3be688b97ea0bd7a6d)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
| -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); + } } } |
