From ccf57b4de16edd3951081a76f792dae64ca6258e Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Thu, 1 Dec 2016 16:52:41 +0100 Subject: [PATCH] Bug 1320101 - mNegotiatedMaxBitrate should be able to cap the max bitrate. r=bwc,jesup MozReview-Commit-ID: 9WRUa0SKuM2 --HG-- extra : rebase_source : c7da24a7a4a061eaadee62b23f98601b75d1fe2c --- media/webrtc/signaling/src/media-conduit/VideoConduit.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp index aa3b98cd864e..68cf0137fab8 100755 --- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp +++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp @@ -1187,9 +1187,8 @@ WebrtcVideoConduit::SelectBitrates(unsigned short width, // simulcast layers in this encoding! So sum(layers.maxBitrate) <= // mNegotiatedMaxBitrate // Note that out_max already has had mPrefMaxBitrate applied to it - if (mNegotiatedMaxBitrate != 0 && mNegotiatedMaxBitrate > out_max) { - out_max = mNegotiatedMaxBitrate; - } + out_max = MinIgnoreZero(mNegotiatedMaxBitrate, out_max); + MOZ_ASSERT(mPrefMaxBitrate == 0 || out_max <= mPrefMaxBitrate); }