Bug 1584560 - On default settings use the actual device channel count. r=padenot
authorAlex Chronopoulos <achronop@gmail.com>
Mon, 30 Sep 2019 09:15:42 +0000
changeset 495615 c6d0570a09eed3bb6e15073d61175ff4e312407b
parent 495614 4a3a7ec8d813d1f319d453abbcce3d43acb908db
child 495616 b4dca3917f04471ed4af04cba7b040ee10fad7e8
push id114140
push userdvarga@mozilla.com
push dateWed, 02 Oct 2019 18:04:51 +0000
treeherdermozilla-inbound@32eb0ea893f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1584560
milestone71.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 1584560 - On default settings use the actual device channel count. r=padenot In `MediaEngineWebRTCMicrophoneSource::EvaluateSettings`, on default settings, the `prefs.mChannels` is updated accordingly. However, it is not used for the calculation of the `FlattenedConstraints`. As a result, the channel count is 0, which is converted to 1, and not the actual device channel count as it should. Thus, the `prefs.mChannels` is used in the calculation of the `FlattenedConstraints`. Differential Revision: https://phabricator.services.mozilla.com/D47453
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -117,17 +117,17 @@ nsresult MediaEngineWebRTCMicrophoneSour
   // or lower, it has no effect.
   if (aInPrefs.mChannels <= 0) {
     prefs.mChannels = maxChannels;
   }
 
   // Get the number of channels asked for by content, and clamp it between the
   // pref and the maximum number of channels that the device supports.
   prefs.mChannels =
-      c.mChannelCount.Get(std::min(aInPrefs.mChannels, maxChannels));
+      c.mChannelCount.Get(std::min(prefs.mChannels, maxChannels));
   prefs.mChannels = std::max(1, std::min(prefs.mChannels, maxChannels));
 
   LOG("Audio config: aec: %d, agc: %d, noise: %d, channels: %d",
       prefs.mAecOn ? prefs.mAec : -1, prefs.mAgcOn ? prefs.mAgc : -1,
       prefs.mNoiseOn ? prefs.mNoise : -1, prefs.mChannels);
 
   *aOutPrefs = prefs;