Index: content/renderer/media/webmediaplayer_impl.cc |
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc |
index 6aa009a18f401e9d954f6649fbfd9c073f53c634..0bda2f77804736192af34362b634462d946a24d7 100644 |
--- a/content/renderer/media/webmediaplayer_impl.cc |
+++ b/content/renderer/media/webmediaplayer_impl.cc |
@@ -167,7 +167,6 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( |
accelerated_compositing_reported_(false), |
incremented_externally_allocated_memory_(false), |
gpu_factories_(RenderThreadImpl::current()->GetGpuFactories()), |
- is_local_source_(false), |
supports_save_(true), |
starting_(false), |
chunk_demuxer_(NULL), |
@@ -318,18 +317,15 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
// Otherwise it's a regular request which requires resolving the URL first. |
data_source_.reset(new BufferedDataSource( |
+ url, |
+ static_cast<BufferedResourceLoader::CORSMode>(cors_mode), |
main_loop_, |
frame_, |
media_log_.get(), |
&buffered_data_source_host_, |
base::Bind(&WebMediaPlayerImpl::NotifyDownloading, AsWeakPtr()))); |
data_source_->Initialize( |
- url, static_cast<BufferedResourceLoader::CORSMode>(cors_mode), |
- base::Bind( |
- &WebMediaPlayerImpl::DataSourceInitialized, |
- AsWeakPtr(), gurl)); |
- |
- is_local_source_ = !gurl.SchemeIsHTTPOrHTTPS(); |
+ base::Bind(&WebMediaPlayerImpl::DataSourceInitialized, AsWeakPtr())); |
} |
void WebMediaPlayerImpl::play() { |
@@ -1114,7 +1110,7 @@ void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, |
default_url_gurl); |
} |
-void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) { |
+void WebMediaPlayerImpl::DataSourceInitialized(bool success) { |
DCHECK(main_loop_->BelongsToCurrentThread()); |
if (!success) { |
@@ -1250,8 +1246,8 @@ void WebMediaPlayerImpl::SetReadyState(WebMediaPlayer::ReadyState state) { |
DCHECK(main_loop_->BelongsToCurrentThread()); |
DVLOG(1) << "SetReadyState: " << state; |
- if (state == WebMediaPlayer::ReadyStateHaveEnoughData && |
- is_local_source_ && |
+ if (state == WebMediaPlayer::ReadyStateHaveEnoughData && data_source_ && |
+ data_source_->assume_fully_buffered() && |
network_state_ == WebMediaPlayer::NetworkStateLoading) |
SetNetworkState(WebMediaPlayer::NetworkStateLoaded); |