bug 1457060 dereference MixerCallback and receiver on separate lines r?padenot draft
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 26 Apr 2018 18:30:31 +1200
changeset 788293 6ab980a7bd6501a896ec0262f970f6c9e0c8f8a4
parent 788286 76f35d0ecaa690917347f2b0f97180b05e7272bb
push id107944
push userktomlinson@mozilla.com
push dateThu, 26 Apr 2018 06:55:03 +0000
reviewerspadenot
bugs1457060
milestone61.0a1
bug 1457060 dereference MixerCallback and receiver on separate lines r?padenot MozReview-Commit-ID: JNltGvA6tMv
dom/media/AudioMixer.h
--- 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,