Bug 1020205 - Reset mRemainingResamplerTail when no longer using the resampler. r=padenot, a=1.3+
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 07 Jul 2014 10:27:10 -0400
changeset 172373 20f7440a1950d14a96340343ad7672577dab7404
parent 172372 0d2195eaedab889943900ee952825273ebda5495
child 172374 c4a703996a6e307f6b3f2ccf28aa7f4f8f633441
push id672
push userryanvm@gmail.com
push dateMon, 07 Jul 2014 18:30:39 +0000
reviewerspadenot, 1.3
bugs1020205
milestone28.0
Bug 1020205 - Reset mRemainingResamplerTail when no longer using the resampler. r=padenot, a=1.3+
content/media/webaudio/AudioBufferSourceNode.cpp
--- a/content/media/webaudio/AudioBufferSourceNode.cpp
+++ b/content/media/webaudio/AudioBufferSourceNode.cpp
@@ -128,16 +128,17 @@ public:
     mBuffer = aBuffer;
   }
 
   SpeexResamplerState* Resampler(AudioNodeStream* aStream, uint32_t aChannels)
   {
     if (aChannels != mChannels && mResampler) {
       speex_resampler_destroy(mResampler);
       mResampler = nullptr;
+      mRemainingResamplerTail = 0;
     }
 
     if (!mResampler) {
       mChannels = aChannels;
       mResampler = speex_resampler_init(mChannels, mBufferSampleRate,
                                         ComputeFinalOutSampleRate(aStream->SampleRate()),
                                         SPEEX_RESAMPLER_QUALITY_DEFAULT,
                                         nullptr);