Bug 1447982 - Rename mLastPrefs to mNetPrefs and update comment for clarity. r=padenot

MozReview-Commit-ID: CJPSDG5OHBs

--HG--
extra : rebase_source : 4be85639204fb53f02f1f5262fa945b78a97b286
This commit is contained in:
Andreas Pehrson 2018-03-26 12:24:17 +02:00
Родитель 83d5534ca3
Коммит aaf89f2684
2 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -250,7 +250,7 @@ MediaEngineWebRTCMicrophoneSource::Reconfigure(const RefPtr<AllocationHandle>& 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<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(mDelayAgnostic));
mAudioProcessing->SetExtraOptions(config);
}
mLastPrefs = prefs;
mNetPrefs = prefs;
return NS_OK;
}