Bug 1031491 - Avoid collision on partial audio frames in the OutputObserver. r=padenot, a=sledru
authorRandell Jesup <rjesup@jesup.org>
Tue, 08 Jul 2014 08:46:28 -0400
changeset 208889 ee04d4a920a74e6583fa55104e2e2f017e65e032
parent 208888 58fd51655b270ec57a1503bcc88c509502d8052a
child 208890 4c63c27ed22d25d66513542a74538e18f4dd8262
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, sledru
bugs1031491
milestone32.0a2
Bug 1031491 - Avoid collision on partial audio frames in the OutputObserver. r=padenot, a=sledru
content/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/content/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/content/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -60,26 +60,27 @@ AudioOutputObserver::AudioOutputObserver
 {
   // Buffers of 10ms chunks
   mPlayoutFifo = new webrtc::SingleRwFifo(MAX_AEC_FIFO_DEPTH/10);
 }
 
 AudioOutputObserver::~AudioOutputObserver()
 {
   Clear();
+  moz_free(mSaved);
+  mSaved = nullptr;
 }
 
 void
 AudioOutputObserver::Clear()
 {
   while (mPlayoutFifo->size() > 0) {
     moz_free(mPlayoutFifo->Pop());
   }
-  moz_free(mSaved);
-  mSaved = nullptr;
+  // we'd like to touch mSaved here, but we can't if we might still be getting callbacks
 }
 
 FarEndAudioChunk *
 AudioOutputObserver::Pop()
 {
   return (FarEndAudioChunk *) mPlayoutFifo->Pop();
 }