aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
diff options
context:
space:
mode:
authorKerryJ <kerry@iodrive.co.za>2019-10-17 11:31:11 +0200
committerKerryJ <kerry@iodrive.co.za>2019-10-17 11:31:11 +0200
commitef3df7baaf81dd509278505d38eae199209cd635 (patch)
tree216252fb66895041b94e35969e45c2812ab42a8f /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
parentd8c3b26fa686e440912a45d82bb9866b4b66822c (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.cs18
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);
+ }
}
}