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

Unified Diff: Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp

Issue 12317033: Merge 141851 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 10 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/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
===================================================================
--- Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp (revision 143515)
+++ Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp (working copy)
@@ -101,6 +101,14 @@
return;
}
+ // After calling setBuffer() with a buffer having a different number of channels, there can in rare cases be a slight delay
+ // before the output bus is updated to the new number of channels because of use of tryLocks() in the context's updating system.
+ // In this case, if the the buffer has just been changed and we're not quite ready yet, then just output silence.
+ if (numberOfChannels() != buffer()->numberOfChannels()) {
+ outputBus->zero();
+ return;
+ }
+
size_t quantumFrameOffset;
size_t bufferFramesToProcess;
@@ -155,7 +163,7 @@
bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destinationFrameOffset, size_t numberOfFrames)
{
ASSERT(context()->isAudioThread());
-
+
// Basic sanity checking
ASSERT(bus);
ASSERT(buffer());
« 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