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 165839 9ced7065dec43d658cbab16ebbd8209583d5badc
parent 165838 fe16e582db9f24c80954ad596cf8e75146012c0b
child 165840 1a12845a97ce8c4b2a00d61228ea7485afe648ff
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [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);