Bug 1595819 - Limit the audio output channel count maximum reported value if RFP is enabled. r=tjr
authorPaul Adenot <paul@paul.cx>
Wed, 13 Nov 2019 12:24:11 +0000
changeset 501740 f11a1221a1adf18caae99adcfc4bd24a0fb44c72
parent 501739 b8a3793ecceb864e30b0c7d060dc9397770b1d9e
child 501741 7db3af2ab4045e73695595aafb07857ed05b26fc
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstjr
bugs1595819
milestone72.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 1595819 - Limit the audio output channel count maximum reported value if RFP is enabled. r=tjr Stereo output is what the immense majority of mobile and desktop users have. Differential Revision: https://phabricator.services.mozilla.com/D52693
dom/media/webaudio/AudioContext.cpp
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -660,16 +660,19 @@ void AudioContext::RegisterActiveNode(Au
   }
 }
 
 void AudioContext::UnregisterActiveNode(AudioNode* aNode) {
   mActiveNodes.RemoveEntry(aNode);
 }
 
 uint32_t AudioContext::MaxChannelCount() const {
+  if (nsRFPService::IsResistFingerprintingEnabled()) {
+    return 2;
+  }
   return std::min<uint32_t>(
       WebAudioUtils::MaxChannelCount,
       mIsOffline ? mNumberOfChannels : CubebUtils::MaxNumberOfChannels());
 }
 
 uint32_t AudioContext::ActiveNodeCount() const { return mActiveNodes.Count(); }
 
 MediaTrackGraph* AudioContext::Graph() const {