WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
78386
Round off error in setValueCurveAtTime
https://bugs.webkit.org/show_bug.cgi?id=78386
Summary
Round off error in setValueCurveAtTime
Raymond Toy
Reported
2012-02-10 14:03:34 PST
There is a round-off error in setValueCurveAtTime. When calling setValueCurveAtTime(curve, 0.0, 0.3) with a sample rate of 44100 and the curve data being sample-frame spaced of exactly the right length, the output has one sample duplicated, causing the rest of the values to be shifted. This is caused by a roundoff error at the line: unsigned curveIndex = static_cast<unsigned>(curveVirtualIndex); In this particular example, curveVirtualIndex = 895.9999 instead of 896 due to roundoff. The curveIndex is set to 895 which causes curve[895] to be output. But it was already output the previous time, so the output is duplicated and the output has the curve values shifted by one. Rounding curveVirtualIndex instead of truncating fixes this.
Attachments
Add attachment
proposed patch, testcase, etc.
Raymond Toy
Comment 1
2012-02-21 14:22:31 PST
It might be easiest to fix this in
bug 77666
, which is how this error was found.
Raymond Toy
Comment 2
2012-03-02 09:58:02 PST
This was fixed in
bug 77666
. Closing this out now.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug