Bug 1403714 - Only regard max_fs when set explicitly. r=dminor
authorAndreas Pehrson <pehrsons@mozilla.com>
Thu, 28 Sep 2017 18:34:36 +0200
changeset 383563 6314d54af8b87a7bff0fcda9a93732b9d5cef476
parent 383562 52fb045e622a10a17b4dc40b1474c1c987b6ca9b
child 383564 859483e77e443a94df04a54768cfcf6a35319994
push id52301
push userdrno@ohlmeier.org
push dateThu, 28 Sep 2017 20:43:57 +0000
treeherderautoland@6314d54af8b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdminor
bugs1403714
milestone58.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 1403714 - Only regard max_fs when set explicitly. r=dminor MozReview-Commit-ID: DczP0bq96AW
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
@@ -1904,22 +1904,26 @@ WebrtcVideoConduit::OnSinkWantsChanged(
   if (!mLockScaling) {
     mLastSinkWanted = wants;
 
     // limit sink wants based upon max-fs constraint
     int max_fs = mCurSendCodecConfig->mEncodingConstraints.maxFs*(16*16);
     rtc::Optional<int> max_pixel_count = wants.max_pixel_count;
     rtc::Optional<int> max_pixel_count_step_up = wants.max_pixel_count_step_up;
 
-    if (max_pixel_count.value_or(max_fs) > max_fs) {
-      max_pixel_count = rtc::Optional<int>(max_fs);
-    }
+    if (max_fs > 0) {
+      // max_fs was explicitly set by signaling and needs to be accounted for
 
-    if (max_pixel_count_step_up.value_or(max_fs) > max_fs) {
-      max_pixel_count_step_up = rtc::Optional<int>(max_fs);
+      if (max_pixel_count.value_or(max_fs) > max_fs) {
+        max_pixel_count = rtc::Optional<int>(max_fs);
+      }
+
+      if (max_pixel_count_step_up.value_or(max_fs) > max_fs) {
+        max_pixel_count_step_up = rtc::Optional<int>(max_fs);
+      }
     }
 
     mVideoAdapter.OnResolutionRequest(max_pixel_count,
                                       max_pixel_count_step_up);
   }
 }
 
 MediaConduitErrorCode