diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-10-27 13:52:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-27 13:52:08 -0400 |
| commit | 53ee78170ad3d5d5d0ecac2dbe8dcbfb13940e46 (patch) | |
| tree | 1ad4126058814609352d41b78662fd5838d6677a /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | 2cdf5c203a9335100b19b9609a738e1b64d6631d (diff) | |
| parent | c9f4a74af02e08b895cd6a8b8a408b1c0edfb6c4 (diff) | |
Merge branch 'master' into copr-fix
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); + } } } |
