From 965591c7132b1e4c8cbe4d2ce433dcb5791aa1d0 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Thu, 10 Sep 2015 08:39:12 +1200 Subject: [PATCH] bug 1203380 add custom assignment operator to AudioBlock r=padenot --HG-- extra : rebase_source : 620bcfe8e7841ab1b19790abbf4df87a3e083c35 --- dom/media/webaudio/AudioBlock.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/media/webaudio/AudioBlock.h b/dom/media/webaudio/AudioBlock.h index 2a96a310af81..da3b2d2b9e8d 100644 --- a/dom/media/webaudio/AudioBlock.h +++ b/dom/media/webaudio/AudioBlock.h @@ -74,6 +74,12 @@ public: mBufferFormat = AUDIO_FORMAT_SILENCE; } + AudioBlock& operator=(const AudioBlock& aBlock) { + // Instead of just copying, mBufferIsDownstreamRef must be first cleared + // if set. It is set again for the new mBuffer if possible. This happens + // in SetBuffer(). + return *this = aBlock.AsAudioChunk(); + } AudioBlock& operator=(const AudioChunk& aChunk) { MOZ_ASSERT(aChunk.mDuration == WEBAUDIO_BLOCK_SIZE); SetBuffer(aChunk.mBuffer);