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

Unified Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp

Issue 1967393002: [DO NOT SUBMIT] AudioWorklet FS2: audio thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FS1-audioworklet-script-importing
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index f82b93abecc2c78ca57ac9a6d0d8796364db2f99..2363ae5cbf11d7ea48d39286fd470b0e4ee00031 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -163,9 +163,9 @@ void OfflineAudioDestinationHandler::doOfflineRendering()
// Reset the suspend flag.
m_shouldSuspend = false;
- // If there is more to process and there is no suspension at the moment,
- // do continue to render quanta. Then calling OfflineAudioContext.resume() will pick up
- // the render loop again from where it was suspended.
+ // If there is more to process and there is no suspension at the moment, do
+ // continue to render quanta. Then calling OfflineAudioContext.resume() will
+ // pick up the render loop again from where it was suspended.
while (m_framesToProcess > 0 && !m_shouldSuspend) {
// Suspend the rendering and update m_shouldSuspend if a scheduled
@@ -271,23 +271,27 @@ bool OfflineAudioDestinationHandler::renderIfNotSuspended(AudioBus* sourceBus, A
return true;
}
- // Prepare the local audio input provider for this render quantum.
- if (sourceBus)
- m_localAudioInputProvider.set(sourceBus);
+ // TODO(hongchan): OfflineAudioContext does not care about the live input.
+ // Remove this.
+ // if (sourceBus)
+ // m_localAudioInputProvider.setSourceBus(sourceBus);
ASSERT(numberOfInputs() >= 1);
if (numberOfInputs() < 1) {
destinationBus->zero();
return false;
}
+
// This will cause the node(s) connected to us to process, which in turn will pull on their input(s),
// all the way backwards through the rendering graph.
AudioBus* renderedBus = input(0).pull(destinationBus, numberOfFrames);
+ // TODO(hongchan): this logic should be a part of AudioNodeInput::pull().
if (!renderedBus) {
destinationBus->zero();
} else if (renderedBus != destinationBus) {
- // in-place processing was not possible - so copy
+ // If the destination node has multiple inputs, in-place processing is
+ // not possible. Thus the explicit copy is necessary.
destinationBus->copyFrom(*renderedBus);
}

Powered by Google App Engine
This is Rietveld 408576698