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

Unified Diff: media/base/pipeline_impl.cc

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: media/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 386b064a96221aa8d344c5ad5e9dd74a7d9d92d1..c5d4082b8bee1aed9b810019497ca5a1013cc543 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -309,7 +309,7 @@ void PipelineImpl::GetNaturalVideoSize(gfx::Size* out_size) const {
bool PipelineImpl::IsStreaming() const {
base::AutoLock auto_lock(lock_);
- return streaming_;
+ return streaming_ || media_stream_;
}
bool PipelineImpl::IsLoaded() const {
@@ -358,6 +358,7 @@ void PipelineImpl::ResetState() {
buffered_time_ = kZero;
buffered_bytes_ = 0;
streaming_ = false;
+ media_stream_ = false;
loaded_ = false;
total_bytes_ = 0;
natural_size_.SetSize(0, 0);
@@ -547,6 +548,12 @@ void PipelineImpl::SetNaturalVideoSize(const gfx::Size& size) {
natural_size_ = size;
}
+void PipelineImpl::SetMediaStream(bool is_media_stream) {
+ base::AutoLock auto_lock(lock_);
+ media_stream_ = is_media_stream;
+ download_rate_monitor_.set_media_stream(media_stream_);
+}
+
void PipelineImpl::SetStreaming(bool streaming) {
DCHECK(IsRunning());
media_log_->AddEvent(
@@ -555,6 +562,7 @@ void PipelineImpl::SetStreaming(bool streaming) {
base::AutoLock auto_lock(lock_);
streaming_ = streaming;
+ download_rate_monitor_.set_streaming(streaming_);
}
void PipelineImpl::NotifyEnded() {

Powered by Google App Engine
This is Rietveld 408576698