Index: Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp |
=================================================================== |
--- Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp (revision 142675) |
+++ Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp (working copy) |
@@ -117,7 +117,11 @@ |
ASSERT(isSafe); |
if (isSafe) { |
- nonSilentFramesToProcess -= framesToZero; |
+ if (framesToZero > nonSilentFramesToProcess) |
+ nonSilentFramesToProcess = 0; |
+ else |
+ nonSilentFramesToProcess -= framesToZero; |
+ |
for (unsigned i = 0; i < outputBus->numberOfChannels(); ++i) |
memset(outputBus->channel(i)->mutableData() + zeroStartFrame, 0, sizeof(float) * framesToZero); |
} |