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

Unified Diff: media/blink/webmediaplayer_impl.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 | « media/blink/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index f138f0e36afff76de8407cad0e7dcd2df7b61398..5d55a43cdf6018475fb921ab1c05b3c97f9a16aa 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -291,7 +291,7 @@ void WebMediaPlayerImpl::pause() {
pipeline_.SetPlaybackRate(0.0f);
if (data_source_)
data_source_->MediaIsPaused();
- paused_time_ = pipeline_.GetMediaTime();
+ UpdatePausedTime();
media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::PAUSE));
@@ -749,8 +749,7 @@ void WebMediaPlayerImpl::OnPipelineSeeked(bool time_changed,
}
// Update our paused time.
- if (paused_)
- paused_time_ = pipeline_.GetMediaTime();
+ UpdatePausedTime();
should_notify_time_changed_ = time_changed;
}
@@ -1030,4 +1029,12 @@ WebMediaPlayerImpl::GetCurrentFrameFromCompositor() {
return video_frame;
}
+void WebMediaPlayerImpl::UpdatePausedTime() {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+ if (paused_) {
xhwang 2015/01/08 22:44:50 I felt it more clear to keep the |paused_| check o
DaleCurtis 2015/01/08 23:16:41 Done.
+ paused_time_ =
+ ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
xhwang 2015/01/08 22:44:50 Hmm, please remind me in what case can |ended_| be
DaleCurtis 2015/01/08 23:16:41 pause() is always called upon ended from HTMLMedia
xhwang 2015/01/08 23:26:19 Thanks for the info! Maybe add a comment to make t
DaleCurtis 2015/01/08 23:41:53 Done.
+ }
+}
+
} // namespace media
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698