Bug 864606 - Take the gain node's input chunk volume into account when we have automation events for changing the gain value; r=padenot
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 22 Apr 2013 22:05:16 -0400
changeset 140573 1bc4280c4c0adaa7773815e65ffe5aff140c7e6d
parent 140572 a4ab443b1eb19bd9ef1dabcea5f215f55c4a11cf
child 140574 9c69d844032ec88744c6eb5d1e9eca24729b2ffe
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs864606
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 864606 - Take the gain node's input chunk volume into account when we have automation events for changing the gain value; r=padenot
content/media/webaudio/GainNode.cpp
--- a/content/media/webaudio/GainNode.cpp
+++ b/content/media/webaudio/GainNode.cpp
@@ -72,17 +72,17 @@ public:
       // timeline at hand, and then for each channel, multiply the values
       // in the buffer with the gain vector.
 
       // Compute the gain values for the duration of the input AudioChunk
       // XXX we need to add a method to AudioEventTimeline to compute this buffer directly.
       float computedGain[WEBAUDIO_BLOCK_SIZE];
       for (size_t counter = 0; counter < WEBAUDIO_BLOCK_SIZE; ++counter) {
         TrackTicks tick = aStream->GetCurrentPosition() + counter;
-        computedGain[counter] = mGain.GetValueAtTime<TrackTicks>(tick);
+        computedGain[counter] = mGain.GetValueAtTime<TrackTicks>(tick) * aInput.mVolume;
       }
 
       // Apply the gain to the output buffer
       for (size_t channel = 0; channel < aOutput->mChannelData.Length(); ++channel) {
         float* buffer = static_cast<float*> (const_cast<void*>
                           (aOutput->mChannelData[channel]));
         AudioBlockCopyChannelWithScale(buffer, computedGain, buffer);
       }