Merge pull request #1909 from KerryRJ/FixDvdsFailingToPlay

Fix System.NullReferenceException when playing Dvds copied to HDD

(cherry picked from commit fdb0c3a1df)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
Bond-009 2019-10-20 17:10:43 +02:00 committed by Joshua Boniface
parent 0212c0b85f
commit 86a50367b2

View file

@ -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);
}
}
}