b=923301 keep a tail-time reference on DelayNode until *after* the last non-silent block has been produced r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 25 Oct 2013 12:11:24 +1300
changeset 166791 9ced7065dec43d658cbab16ebbd8209583d5badc
parent 166790 fe16e582db9f24c80954ad596cf8e75146012c0b
child 166792 1a12845a97ce8c4b2a00d61228ea7485afe648ff
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs923301
milestone27.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
b=923301 keep a tail-time reference on DelayNode until *after* the last non-silent block has been produced r=roc This gives a downstream node a chance to take a tail-time reference when it receives the last non-silent block from the DelayNode.
content/media/webaudio/DelayNode.cpp
--- a/content/media/webaudio/DelayNode.cpp
+++ b/content/media/webaudio/DelayNode.cpp
@@ -88,28 +88,28 @@ public:
     if (!aInput.IsNull()) {
       if (mLeftOverData <= 0) {
         nsRefPtr<PlayingRefChanged> refchanged =
           new PlayingRefChanged(aStream, PlayingRefChanged::ADDREF);
         NS_DispatchToMainThread(refchanged);
       }
       mLeftOverData = mProcessor.MaxDelayFrames();
     } else if (mLeftOverData != INT32_MIN) {
-      mLeftOverData -= WEBAUDIO_BLOCK_SIZE;
       if (mLeftOverData <= 0) {
         // Continue spamming the main thread with messages until we are destroyed.
         // This isn't great, but it ensures a message will get through even if
         // some are ignored by DelayNode::AcceptPlayingRefRelease
         mLeftOverData = 0;
         playedBackAllLeftOvers = true;
 
         nsRefPtr<PlayingRefChanged> refchanged =
           new PlayingRefChanged(aStream, PlayingRefChanged::RELEASE);
         NS_DispatchToMainThread(refchanged);
       }
+      mLeftOverData -= WEBAUDIO_BLOCK_SIZE;
     }
 
     AllocateAudioBlock(numChannels, aOutput);
 
     AudioChunk input = aInput;
     if (!aInput.IsNull() && aInput.mVolume != 1.0f) {
       // Pre-multiply the input's volume
       AllocateAudioBlock(numChannels, &input);