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

Unified Diff: media/base/pipeline.cc

Issue 325503003: Fix seeking when the start time is non-zero. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 46be2b86e6809c592bc554fefdf8ee456b76b14d..8fbc094c1ac0b56f32af4c513009fad9dbbbdaf1 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -743,17 +743,21 @@ void Pipeline::SeekTask(TimeDelta time, const PipelineStatusCB& seek_cb) {
DCHECK(seek_cb_.is_null());
SetState(kSeeking);
- base::TimeDelta seek_timestamp = std::max(time, demuxer_->GetStartTime());
seek_cb_ = seek_cb;
audio_ended_ = false;
video_ended_ = false;
text_ended_ = false;
+ // Adjust the seek timestamp by the start time (which may be negative). Don't
+ // use this value with SetTime() since it maps to a [0, duration] based
+ // timeline instead of a [start_time, duration + start_time] one internally.
+ const base::TimeDelta seek_timestamp = time + demuxer_->GetStartTime();
+
// Kick off seeking!
{
base::AutoLock auto_lock(lock_);
PauseClockAndStopRendering_Locked();
- clock_->SetTime(seek_timestamp, seek_timestamp);
+ clock_->SetTime(time, time);
acolwell GONE FROM CHROMIUM 2014/06/09 23:14:46 This makes me really nervous and I'm pretty sure i
}
DoSeek(seek_timestamp, base::Bind(
&Pipeline::OnStateTransition, base::Unretained(this)));
« no previous file with comments | « no previous file | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698