DelayNode doesn't work if delayTime.value == delayTime.maxValue
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 21:10:37 +0000 (21:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jul 2012 21:10:37 +0000 (21:10 +0000)
commit3ed2cf094d4354d2e9f55a8ce12c755245cbdca1
tree04adb0a41d3f266aa23f9d68275e16d48b569de4
parent7af131d5b63e8cf08f9ce8c11b3ef0e0da4b6d98
DelayNode doesn't work if delayTime.value == delayTime.maxValue
https://bugs.webkit.org/show_bug.cgi?id=90357

Patch by Raymond Toy <rtoy@google.com> on 2012-07-13
Reviewed by Kenneth Russell.

Source/WebCore:

Increase delay buffer size slightly so that the read and write
pointers don't become equal when the delay and the max delay are
the same.

Tests: webaudio/delaynode-max-default-delay.html
       webaudio/delaynode-max-nondefault-delay.html

* Modules/webaudio/DelayDSPKernel.cpp:
(WebCore): Moved SmoothingTimeConstant to WebCore namespace.
(WebCore::DelayDSPKernel::DelayDSPKernel): Add some additional checks to prevent crashes; use bufferLengthForDelay to compute buffer length.
(WebCore::DelayDSPKernel::bufferLengthForDelay): New function to compute buffer length.
* Modules/webaudio/DelayDSPKernel.h:
(DelayDSPKernel): Declare bufferLengthForDelay.

LayoutTests:

New tests to test the case when the delay node delay equals the
maximum allowed delay. Add one test for the default maximum delay
and a second test with a user-set maximum delay.

* webaudio/delaynode-max-default-delay-expected.txt: Added.
* webaudio/delaynode-max-default-delay.html: Added.
* webaudio/delaynode-max-nondefault-delay-expected.txt: Added.
* webaudio/delaynode-max-nondefault-delay.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webaudio/delaynode-max-default-delay-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/delaynode-max-default-delay.html [new file with mode: 0644]
LayoutTests/webaudio/delaynode-max-nondefault-delay-expected.txt [new file with mode: 0644]
LayoutTests/webaudio/delaynode-max-nondefault-delay.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/DelayDSPKernel.cpp
Source/WebCore/Modules/webaudio/DelayDSPKernel.h