Index: media/blink/webmediaplayer_impl.cc |
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc |
index 93f3bd43cf20d7f92c05ff5cc423e3a716159334..3d0557e9be4e5e59879f2faaef0bbd1cd6362929 100644 |
--- a/media/blink/webmediaplayer_impl.cc |
+++ b/media/blink/webmediaplayer_impl.cc |
@@ -789,8 +789,7 @@ void WebMediaPlayerImpl::OnPipelineMetadata( |
pipeline_metadata_ = metadata; |
- UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", |
- metadata.video_rotation, |
+ UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation, |
VIDEO_ROTATION_MAX + 1); |
SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
@@ -824,6 +823,14 @@ void WebMediaPlayerImpl::OnPipelineBufferingStateChanged( |
DCHECK_EQ(buffering_state, BUFFERING_HAVE_ENOUGH); |
SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData); |
+ // If we were only tasked to preload and a play request hasn't come in yet, |
+ // cancel the DataSource once it reaches the deferred state if it isn't |
+ // already. Subsequent play requests will restart the DataSource. |
+ if (preload_ == BufferedDataSource::METADATA && data_source_ && |
+ !data_source_->IsStreaming() && !data_source_->media_has_played()) { |
+ data_source_->CancelUponDeferral(); |
+ } |
xhwang
2015/03/26 07:21:55
Seems like |data_source_| knows the preload type,
DaleCurtis
2015/03/26 17:22:00
Great idea!
|
+ |
// Blink expects a timeChanged() in response to a seek(). |
if (should_notify_time_changed_) |
client_->timeChanged(); |