Bug 1140648 - WebRTC check codec config max frame rate is set before using r=jesup
authorEthan Hugg <ethanhugg@gmail.com>
Fri, 06 Mar 2015 19:05:11 -0800
changeset 232380 df5ecdd940d482f80183e5080bd6824bd3b81129
parent 232379 cb5ec48a3391b2de74644581bfc801095311aee8
child 232381 45d3767f69e3a88a51652f34d1e5fbcedb98c67a
push id28377
push userphilringnalda@gmail.com
push dateSun, 08 Mar 2015 03:12:31 +0000
treeherdermozilla-central@eeaf226575f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1140648
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1140648 - WebRTC check codec config max frame rate is set before using r=jesup
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
@@ -977,21 +977,24 @@ WebrtcVideoConduit::SelectSendFrameRate(
   {
     unsigned int cur_fs, mb_width, mb_height, max_fps;
 
     mb_width = (mSendingWidth + 15) >> 4;
     mb_height = (mSendingHeight + 15) >> 4;
 
     cur_fs = mb_width * mb_height;
     max_fps = mCurSendCodecConfig->mMaxMBPS/cur_fs;
-    if (max_fps < mSendingFramerate)
+    if (max_fps < mSendingFramerate) {
       mSendingFramerate = max_fps;
+    }
 
-    if (mCurSendCodecConfig->mMaxFrameRate < mSendingFramerate)
+    if (mCurSendCodecConfig->mMaxFrameRate != 0 &&
+      mCurSendCodecConfig->mMaxFrameRate < mSendingFramerate) {
       mSendingFramerate = mCurSendCodecConfig->mMaxFrameRate;
+    }
   }
   if (mSendingFramerate != framerate)
   {
     // Get current vie codec.
     webrtc::VideoCodec vie_codec;
     int32_t err;
 
     if ((err = mPtrViECodec->GetSendCodec(mChannel, vie_codec)) != 0)