summaryrefslogtreecommitdiffstats
path: root/media/blink
diff options
context:
space:
mode:
authorxhwang <xhwang@chromium.org>2014-12-01 13:48:57 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-01 21:49:18 +0000
commit12d8d04346d5453c26c367a67998fb66fcd01deb (patch)
treee1fd77246382c7be26944d36d386a1d3b180927f /media/blink
parentfb5899ed02b2d0e6e7c7e638d2f5082e8b45e8c4 (diff)
downloadchromium_src-12d8d04346d5453c26c367a67998fb66fcd01deb.zip
chromium_src-12d8d04346d5453c26c367a67998fb66fcd01deb.tar.gz
chromium_src-12d8d04346d5453c26c367a67998fb66fcd01deb.tar.bz2
Media Pipeline: Fire seek callback after calling StartPlayingFrom().
The seek callback can trigger "seeked" event in JS. In the current code, seek callback is fired before calling StartPlayingFrom(), this could cause the following race condition to happen: 1, Seek callback is fired on the media thread, and posted to the main thread. 2, "seeked" event is fired in JS. currentTime() is called on the main thread by the JS player. 3, As a result of (2), AudioRendererImpl::CurrentMediaTime() is called on the main thread. 4, Renderer::StartPlayingFrom() is called on the media thread, which calls AudioRendererImpl::SetMediaTime(). As you can see, CurrentMediaTime() is called before SetMediaTime(). Hence step (3) returns an old media time. This CL makes sure we call StartPlayingFrom() before we fire the seek callback, so that SetMediaTime() is always called before we fire "seeked" event. BUG=117921,435342 TEST=Updated PipelineIntegrationTestBase and enabled two tests to cover this. Review URL: https://codereview.chromium.org/766633003 Cr-Commit-Position: refs/heads/master@{#306259}
Diffstat (limited to 'media/blink')
-rw-r--r--media/blink/webmediaplayer_impl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index e5f73f0..74db5fe 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -325,7 +325,7 @@ bool WebMediaPlayerImpl::supportsSave() const {
}
void WebMediaPlayerImpl::seek(double seconds) {
- DVLOG(1) << __FUNCTION__ << "(" << seconds << ")";
+ DVLOG(1) << __FUNCTION__ << "(" << seconds << "s)";
DCHECK(main_task_runner_->BelongsToCurrentThread());
ended_ = false;