Always leave an event in the AudioParam timeline #16373
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, when the last AudioParam event has been processed and is
now in the past, the event would be removed from the timeline. This
was an optimization so that we can skip sample-accurate processing of
the timeline and just returned fixed values. However, if a new event
is added after all events have been deleted, the starting point of the
event could be incorrect. For example a setValueAtTime event in the
past followed by a linearRampToValueAtTime.
Therefore, always leave the very last event in the timeline to
establish the starting event if needed by future events.
Bug: 951863
Change-Id: Iae0b550a4b497b953a10e85e603ecebb59508a99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565375
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652955}