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

Unified Diff: media/base/pipeline_impl.cc

Issue 159573: Nice and easy fix for the media clock interpolating past the duration. (Closed)
Patch Set: Typos Created 11 years, 5 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_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 21b9338afed3b6471dd69646f08769e4859baed1..a09c2c7bd320abbd54392429115ac6196c79f75b 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -202,7 +202,11 @@ void PipelineImpl::SetVolume(float volume) {
base::TimeDelta PipelineImpl::GetCurrentTime() const {
AutoLock auto_lock(lock_);
- return clock_.Elapsed();
+ base::TimeDelta elapsed = clock_.Elapsed();
+ if (elapsed > duration_) {
+ return duration_;
+ }
+ return elapsed;
}
base::TimeDelta PipelineImpl::GetBufferedTime() const {
« no previous file with comments | « media/base/mock_filters.h ('k') | media/base/pipeline_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698