Bug 1001272: Fix AEC far-end audio distortion caused by repeated audio snippets r=padenot
authorRandell Jesup <rjesup@jesup.org>
Fri, 25 Apr 2014 08:10:38 -0400
changeset 180550 c1689525c1af804c9f23e3d6fc4d1bf8c7fa1138
parent 180549 863ba80b665f0f06eec822dde5f9196ac11ad2ae
child 180551 949b53bb379cb3dc62c4858327ec0874fb4867e4
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerspadenot
bugs1001272
milestone31.0a1
Bug 1001272: Fix AEC far-end audio distortion caused by repeated audio snippets r=padenot
content/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/content/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/content/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -137,16 +137,17 @@ AudioOutputObserver::InsertFarEnd(const 
 
 #ifdef LOG_FAREND_INSERTION
     if (fp) {
       fwrite(&(mSaved->mData[mSamplesSaved * aChannels]), to_copy * aChannels, sizeof(int16_t), fp);
     }
 #endif
     aSamples -= to_copy;
     mSamplesSaved += to_copy;
+    aBuffer += to_copy * aChannels;
 
     if (mSamplesSaved >= mChunkSize) {
       int free_slots = mPlayoutFifo->capacity() - mPlayoutFifo->size();
       if (free_slots <= 0) {
         // XXX We should flag an overrun for the reader.  We can't drop data from it due to
         // thread safety issues.
         break;
       } else {