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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1722783003: Resume from time-zero on streaming resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | 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 d155504bae46ec38c056b641233ceba6b7bd6980..7afbbc7e25f22bdea4b57f15add40777962c9541 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -1250,8 +1250,14 @@ void WebMediaPlayerImpl::Resume() {
// It is safe to call GetCurrentFrameTimestamp() because VFC is stopped
// during Suspend(). It won't be started again until after Resume() is
// called. Use the pipeline time if there's no video.
- seek_time_ = hasVideo() ? compositor_->GetCurrentFrameTimestamp()
- : pipeline_.GetMediaTime();
+ if (!data_source_ || !data_source_->IsStreaming()) {
+ seek_time_ = hasVideo() ? compositor_->GetCurrentFrameTimestamp()
+ : pipeline_.GetMediaTime();
+ } else {
+ // Resume from zero if a resource does not support range requests; this
+ // avoids a painful "read-the-whole-file" seek penalty.
+ seek_time_ = base::TimeDelta();
+ }
}
if (chunk_demuxer_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698