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

Unified Diff: media/base/pipeline.cc

Issue 335273002: Fix seeking when the start time is non-zero. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. 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 | « 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 46be2b86e6809c592bc554fefdf8ee456b76b14d..2884c38993b08ad3e43734efc17b21c18b12a8e8 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -386,7 +386,7 @@ void Pipeline::StateTransitionTask(PipelineStatus status) {
base::AutoLock l(lock_);
// We do not want to start the clock running. We only want to set the
// base media time so our timestamp calculations will be correct.
- clock_->SetTime(demuxer_->GetStartTime(), demuxer_->GetStartTime());
+ clock_->SetTime(base::TimeDelta(), base::TimeDelta());
}
if (!audio_renderer_ && !video_renderer_) {
done_cb.Run(PIPELINE_ERROR_COULD_NOT_RENDER);
@@ -445,7 +445,7 @@ void Pipeline::DoInitialPreroll(const PipelineStatusCB& done_cb) {
DCHECK(!pending_callbacks_.get());
SerialRunner::Queue bound_fns;
- base::TimeDelta seek_timestamp = demuxer_->GetStartTime();
+ const base::TimeDelta seek_timestamp = base::TimeDelta();
// Preroll renderers.
if (audio_renderer_) {
@@ -743,7 +743,6 @@ 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;
@@ -753,9 +752,9 @@ void Pipeline::SeekTask(TimeDelta time, const PipelineStatusCB& seek_cb) {
{
base::AutoLock auto_lock(lock_);
PauseClockAndStopRendering_Locked();
- clock_->SetTime(seek_timestamp, seek_timestamp);
+ clock_->SetTime(time, time);
}
- DoSeek(seek_timestamp, base::Bind(
+ DoSeek(time, base::Bind(
&Pipeline::OnStateTransition, base::Unretained(this)));
}
« 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