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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp

Issue 2567183002: k-rate playbackRate and detune reaches final value (Closed)
Patch Set: Address review comments. Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-k-rate.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
index dbb6a1b8defe27a58eb4ce5f9b3cb4d60a898c33..eacec0b72c9e5da2a8b148736bbf19764fd6f25f 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -857,7 +857,15 @@ float AudioParamTimeline::valuesForFrameRangeImpl(size_t startFrame,
// "forever". SetValueCurve also has an explicit SetValue at the end of
// the curve, so we don't need to worry that SetValueCurve time is a
// start time, not an end time.
- if (lastEventTime < currentTime && lastEventType != ParamEvent::SetTarget) {
+ //
+ // Allow at least one render quantum to go by before handling this
+ // to allow k-rate parameters to finish processing the event. See
+ // crbug.com/672857. Due to possible roundoff, arbirtrarily wait
+ // for 1.5 render quanta instead of 1.
+ if (lastEventTime +
+ 1.5 * AudioUtilities::kRenderQuantumFrames / sampleRate <
+ currentTime &&
+ lastEventType != ParamEvent::SetTarget) {
// The event has finished, so just copy the default value out.
// Since all events are now also in the past, we can just remove all
// timeline events too because |defaultValue| has the expected
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-k-rate.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698