From aaf89f2684ebea3661437f6f4baeceaa1846298b Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Mon, 26 Mar 2018 12:24:17 +0200 Subject: [PATCH] Bug 1447982 - Rename mLastPrefs to mNetPrefs and update comment for clarity. r=padenot MozReview-Commit-ID: CJPSDG5OHBs --HG-- extra : rebase_source : 4be85639204fb53f02f1f5262fa945b78a97b286 --- dom/media/webrtc/MediaEngineWebRTC.h | 6 ++++-- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dom/media/webrtc/MediaEngineWebRTC.h b/dom/media/webrtc/MediaEngineWebRTC.h index f31b35d14986..c394df8c0627 100644 --- a/dom/media/webrtc/MediaEngineWebRTC.h +++ b/dom/media/webrtc/MediaEngineWebRTC.h @@ -604,9 +604,11 @@ private: // This is read and written to only on the MSG thread. bool mSkipProcessing; - // To only update microphone when needed, we keep track of previous settings. + // To only update microphone when needed, we keep track of the prefs + // representing the currently applied settings for this source. This is the + // net result of the prefs across all allocations. // Owning thread only. - MediaEnginePrefs mLastPrefs; + MediaEnginePrefs mNetPrefs; // Stores the mixed audio output for the reverse-stream of the AEC. AlignedFloatBuffer mOutputBuffer; diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index d984c3091b66..6ce74c510604 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -250,7 +250,7 @@ MediaEngineWebRTCMicrophoneSource::Reconfigure(const RefPtr& a size_t i = mAllocations.IndexOf(aHandle, 0, AllocationHandleComparator()); MOZ_DIAGNOSTIC_ASSERT(i != mAllocations.NoIndex); - ApplySettings(mLastPrefs, mAllocations[i].mStream->GraphImpl()); + ApplySettings(mNetPrefs, mAllocations[i].mStream->GraphImpl()); return NS_OK; } @@ -471,7 +471,7 @@ MediaEngineWebRTCMicrophoneSource::UpdateSingleSource( case kStarted: case kStopped: - if (prefs.mChannels != mLastPrefs.mChannels) { + if (prefs.mChannels != mNetPrefs.mChannels) { // If the channel count changed, tell the MSG to open a new driver with // the correct channel count. MOZ_ASSERT(!mAllocations.IsEmpty()); @@ -488,7 +488,7 @@ MediaEngineWebRTCMicrophoneSource::UpdateSingleSource( // Get validated number of channel uint32_t channelCount = 0; mAudioInput->GetChannelCount(channelCount); - MOZ_ASSERT(channelCount > 0 && mLastPrefs.mChannels > 0); + MOZ_ASSERT(channelCount > 0 && mNetPrefs.mChannels > 0); if (!stream->OpenNewAudioCallbackDriver(mListener)) { MOZ_LOG(GetMediaManagerLog(), LogLevel::Error, ("Could not open a new AudioCallbackDriver for input")); return NS_ERROR_FAILURE; @@ -519,7 +519,7 @@ MediaEngineWebRTCMicrophoneSource::UpdateSingleSource( config.Set(new webrtc::DelayAgnostic(mDelayAgnostic)); mAudioProcessing->SetExtraOptions(config); } - mLastPrefs = prefs; + mNetPrefs = prefs; return NS_OK; }