Don't subtract too much from nonSilentFramesToProcess
authorrtoy@google.com <rtoy@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jan 2013 00:36:55 +0000 (00:36 +0000)
committerrtoy@google.com <rtoy@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jan 2013 00:36:55 +0000 (00:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107966

Reviewed by Kenneth Russell.

No new tests.

* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp

index b05bf6a7c4d3ac8b2d028f0fd197691df30070a0..a6232cf01956bc45a428c968707508f7aaf5f1bc 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-25  Raymond Toy  <rtoy@google.com>
+
+        Don't subtract too much from nonSilentFramesToProcess
+        https://bugs.webkit.org/show_bug.cgi?id=107966
+
+        Reviewed by Kenneth Russell.
+
+        No new tests.
+
+        * Modules/webaudio/AudioScheduledSourceNode.cpp:
+        (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
+
 2013-01-25  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. Windows build fix by Dean.
index d78bf797c0ba593f949b0a5f9bb0b55e9a53a2a1..f157fb7e20e027c1db8a13ad526c1848612afcb3 100644 (file)
@@ -117,7 +117,11 @@ void AudioScheduledSourceNode::updateSchedulingInfo(size_t quantumFrameSize,
         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);
         }