Bug 1243607: Fix out-of-order limit checks in WebRTC bandwidth settings rs=me
☠☠ backed out by cba3384cdcd9 ☠ ☠
authorRandell Jesup <rjesup@jesup.org>
Thu, 28 Jan 2016 00:37:41 -0500
changeset 326663 5d8f454c269e7fd14e208ff33a1788c97f54a113
parent 326662 aa79ec7cc7ed04340ca5c3c8975f2185ba20c776
child 326664 db9f445144e29b9171be0912c8f8351770541d46
push id10162
push useratolfsen@mozilla.com
push dateThu, 28 Jan 2016 10:52:36 +0000
reviewersme
bugs1243607
milestone47.0a1
Bug 1243607: Fix out-of-order limit checks in WebRTC bandwidth settings rs=me
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -1029,26 +1029,25 @@ WebrtcVideoConduit::SelectBandwidth(webr
     vie_codec.minBitrate = vie_codec.minBitrate * ((10-(framerate/2))/30);
     vie_codec.startBitrate = vie_codec.startBitrate * ((10-(framerate/2))/30);
     vie_codec.maxBitrate = vie_codec.maxBitrate * ((10-(framerate/2))/30);
   }
 
   if (mMinBitrate && mMinBitrate > vie_codec.minBitrate) {
     vie_codec.minBitrate = mMinBitrate;
   }
+  // If we try to set a minimum bitrate that is too low, ViE will reject it.
+  vie_codec.minBitrate = std::max((unsigned int) webrtc::kViEMinCodecBitrate,
+                                  vie_codec.minBitrate);
   if (mStartBitrate && mStartBitrate > vie_codec.startBitrate) {
     vie_codec.startBitrate = mStartBitrate;
   }
   if (mMaxBitrate && mMaxBitrate > vie_codec.maxBitrate) {
     vie_codec.maxBitrate = mMaxBitrate;
   }
-
-  // If we try to set a minimum bitrate that is too low, ViE will reject it.
-  vie_codec.minBitrate = std::max((unsigned int) webrtc::kViEMinCodecBitrate,
-                                  vie_codec.minBitrate);
 }
 
 static void ConstrainPreservingAspectRatioExact(uint32_t max_fs,
                                                 unsigned short* width,
                                                 unsigned short* height)
 {
   unsigned int mb_width = (*width + 15) >> 4;
   unsigned int mb_height = (*height + 15) >> 4;