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

Issue 1097373003: Fix issue with failing to call AudioBufferSource.onended in some cases (Closed)

Created:
5 years, 8 months ago by Raymond Toy
Modified:
5 years, 8 months ago
CC:
blink-reviews
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix issue with failing to call AudioBufferSource.onended in some cases. AudioBufferSource.onended was not being called because we thought the source should have already stopped but had not actually stopped. This happened when starting the source via start(). The current context time was recorded as the start time of the source, but in some cases, this was already too late, and the source would get started at the next rendering quantum. However, the stop time was computed using the recorded start time, so we would expect the source to stop one rendering quantum sooner than it actually would. Because of this, we would stop the source but NOT fire the onended event. To fix this, change the check to add a little extra time before stopping the source. We don't need to be extra precise here; just stop the source some time after it would have stopped. This can't be tested using an offline context because start() always starts at the correct time. Run the manual test and watch the results (in the window) and the console.log. Both tones should be played if everything is working. BUG=478301 TEST=ManualTests/webaudio/audiobuffersource-onended.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194413

Patch Set 1 : WIP, with debugging prints. #

Patch Set 2 : Remove debugging prints #

Patch Set 3 : #

Patch Set 4 : Fix comment. #

Total comments: 6

Patch Set 5 : Update according to review #

Total comments: 5

Patch Set 6 : Rebase and clarify some comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -5 lines) Patch
A ManualTests/webaudio/audiobuffersource-resampling-onended.html View 1 2 1 chunk +97 lines, -0 lines 0 comments Download
M Source/modules/webaudio/AudioBufferSourceNode.cpp View 1 2 3 4 5 3 chunks +23 lines, -5 lines 0 comments Download

Messages

Total messages: 15 (4 generated)
Raymond Toy
PTAL
5 years, 8 months ago (2015-04-21 21:30:33 UTC) #2
hongchan
LGTM with nits. https://codereview.chromium.org/1097373003/diff/60001/Source/modules/webaudio/AudioBufferSourceNode.cpp File Source/modules/webaudio/AudioBufferSourceNode.cpp (right): https://codereview.chromium.org/1097373003/diff/60001/Source/modules/webaudio/AudioBufferSourceNode.cpp#newcode548 Source/modules/webaudio/AudioBufferSourceNode.cpp:548: // start time and the duration, ...
5 years, 8 months ago (2015-04-21 21:39:08 UTC) #3
Raymond Toy
https://codereview.chromium.org/1097373003/diff/60001/Source/modules/webaudio/AudioBufferSourceNode.cpp File Source/modules/webaudio/AudioBufferSourceNode.cpp (right): https://codereview.chromium.org/1097373003/diff/60001/Source/modules/webaudio/AudioBufferSourceNode.cpp#newcode548 Source/modules/webaudio/AudioBufferSourceNode.cpp:548: // start time and the duration, so we end ...
5 years, 8 months ago (2015-04-21 22:00:05 UTC) #4
Raymond Toy
kbr@, PTAL when you're back.
5 years, 8 months ago (2015-04-21 22:02:44 UTC) #6
Ken Russell (switch to Gerrit)
LGTM with a couple of things to think about. https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html File ManualTests/webaudio/audiobuffersource-resampling-onended.html (right): https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html#newcode36 ManualTests/webaudio/audiobuffersource-resampling-onended.html:36: ...
5 years, 8 months ago (2015-04-22 19:01:50 UTC) #7
Raymond Toy
Good questions. Does this answer your concerns? https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html File ManualTests/webaudio/audiobuffersource-resampling-onended.html (right): https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html#newcode36 ManualTests/webaudio/audiobuffersource-resampling-onended.html:36: var context ...
5 years, 8 months ago (2015-04-22 20:19:46 UTC) #8
hongchan
https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html File ManualTests/webaudio/audiobuffersource-resampling-onended.html (right): https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html#newcode36 ManualTests/webaudio/audiobuffersource-resampling-onended.html:36: var context = new AudioContext(); On 2015/04/22 19:01:50, Ken ...
5 years, 8 months ago (2015-04-22 22:30:32 UTC) #9
Raymond Toy
On 2015/04/22 22:30:32, hoch wrote: > https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html > File ManualTests/webaudio/audiobuffersource-resampling-onended.html (right): > > https://codereview.chromium.org/1097373003/diff/80001/ManualTests/webaudio/audiobuffersource-resampling-onended.html#newcode36 > ...
5 years, 8 months ago (2015-04-23 00:09:24 UTC) #10
Raymond Toy
On 2015/04/23 00:09:24, Raymond Toy wrote: > On 2015/04/22 22:30:32, hoch wrote: > > > ...
5 years, 8 months ago (2015-04-24 17:31:18 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097373003/100001
5 years, 8 months ago (2015-04-24 17:33:38 UTC) #14
commit-bot: I haz the power
5 years, 8 months ago (2015-04-24 18:45:31 UTC) #15
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=194413

Powered by Google App Engine
This is Rietveld 408576698