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

Unified Diff: media/base/pipeline.cc

Issue 575643002: Initialize media timeline correctly for positive start times. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 6 years, 3 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 | « media/base/mock_filters.h ('k') | 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 086dd9651b16cdc4f7106d9a44e404ab23a8fa3c..ee742bf408b4193a280e07347fbf25ee3cc88713 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -343,10 +343,12 @@ void Pipeline::StateTransitionTask(PipelineStatus status) {
if (!is_initialized_) {
is_initialized_ = true;
ReportMetadata();
+ start_timestamp_ = demuxer_->GetStartTime();
}
base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
+ DCHECK(start_timestamp_ >= base::TimeDelta());
renderer_->StartPlayingFrom(start_timestamp_);
if (text_renderer_)
@@ -584,13 +586,16 @@ void Pipeline::SeekTask(TimeDelta time, const PipelineStatusCB& seek_cb) {
DCHECK(seek_cb_.is_null());
+ const base::TimeDelta seek_timestamp =
+ std::max(time, demuxer_->GetStartTime());
+
SetState(kSeeking);
seek_cb_ = seek_cb;
renderer_ended_ = false;
text_renderer_ended_ = false;
- start_timestamp_ = time;
+ start_timestamp_ = seek_timestamp;
- DoSeek(time,
+ DoSeek(seek_timestamp,
base::Bind(&Pipeline::OnStateTransition, weak_factory_.GetWeakPtr()));
}
« no previous file with comments | « media/base/mock_filters.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698