Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: Source/modules/webaudio/AudioBufferSourceNode.cpp

Issue 1117293002: AudioBufferSourceNode.start with optional parameters causes processor build-up (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed Typo Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioBufferSourceNode.cpp
diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp
index 2d4e5278dd069a39c15e1e5f78025b92c46ccf4c..ef469e80bf4f83082a46a128019248a2e1239090 100644
--- a/Source/modules/webaudio/AudioBufferSourceNode.cpp
+++ b/Source/modules/webaudio/AudioBufferSourceNode.cpp
@@ -485,6 +485,12 @@ void AudioBufferSourceHandler::startSource(double when, double grainOffset, doub
m_grainOffset = grainOffset;
m_grainDuration = grainDuration;
+ // The node is started. Add a reference to keep us alive so that audio
+ // will eventually get played even if Javascript should drop all references
+ // to this node. The reference will get dropped when the source has finished
+ // playing.
+ context()->notifySourceNodeStartedProcessing(node());
+
// If |when| < currentTime, the source must start now according to the spec.
// So just set startTime to currentTime in this case to start the source now.
m_startTime = std::max(when, context()->currentTime());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698