bug 1457060 dereference MixerCallback and receiver on separate lines r?padenot
MozReview-Commit-ID: JNltGvA6tMv
--- a/dom/media/AudioMixer.h
+++ b/dom/media/AudioMixer.h
@@ -58,21 +58,22 @@ public:
}
/* Get the data from the mixer. This is supposed to be called when all the
* tracks have been mixed in. The caller should not hold onto the data. */
void FinishMixing() {
MOZ_ASSERT(mChannels && mFrames && mSampleRate, "Mix not called for this cycle?");
for (MixerCallback* cb = mCallbacks.getFirst();
cb != nullptr; cb = cb->getNext()) {
- cb->mReceiver->MixerCallback(mMixedAudio.Elements(),
- AudioSampleTypeToFormat<AudioDataValue>::Format,
- mChannels,
- mFrames,
- mSampleRate);
+ MixerCallbackReceiver* receiver = cb->mReceiver;
+ receiver->MixerCallback(mMixedAudio.Elements(),
+ AudioSampleTypeToFormat<AudioDataValue>::Format,
+ mChannels,
+ mFrames,
+ mSampleRate);
}
PodZero(mMixedAudio.Elements(), mMixedAudio.Length());
mSampleRate = mChannels = mFrames = 0;
}
/* Add a buffer to the mix. The buffer can be null if there's nothing to mix
* but the callback is still needed. */
void Mix(AudioDataValue* aSamples,