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

Unified Diff: media/base/pipeline.cc

Issue 843863002: Revert current time clamp on ended; clamp paused time instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 5 years, 11 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') | media/blink/webmediaplayer_impl.cc » ('J')
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 3d210d40c42388bd329f25235f54f496138194d2..9ce867d8ac6fa45c33c60be1c9647123e0cbd699 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -163,17 +163,8 @@ void Pipeline::SetVolume(float volume) {
TimeDelta Pipeline::GetMediaTime() const {
base::AutoLock auto_lock(lock_);
- if (!renderer_)
- return TimeDelta();
-
- // TODO(sriram): In some cases GetMediaTime() returns a value few
- // milliseconds less than duration, even though playback has ended
- // http://crbug.com/438581
- TimeDelta media_time = renderer_->GetMediaTime();
- if (renderer_ended_)
- return duration_;
-
- return std::min(media_time, duration_);
+ return renderer_ ? std::min(renderer_->GetMediaTime(), duration_)
+ : TimeDelta();
}
Ranges<TimeDelta> Pipeline::GetBufferedTimeRanges() const {
« no previous file with comments | « no previous file | media/base/pipeline_unittest.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698