Index: media/base/pipeline_impl.cc |
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc |
index 386b064a96221aa8d344c5ad5e9dd74a7d9d92d1..7de0ee752d642e300dd1ffd5461ff47c45304324 100644 |
--- a/media/base/pipeline_impl.cc |
+++ b/media/base/pipeline_impl.cc |
@@ -251,7 +251,7 @@ base::TimeDelta PipelineImpl::GetBufferedTime() { |
base::AutoLock auto_lock(lock_); |
// If media is fully loaded, then return duration. |
- if (loaded_ || total_bytes_ == buffered_bytes_) { |
+ if (local_source_ || total_bytes_ == buffered_bytes_) { |
max_buffered_time_ = duration_; |
return duration_; |
} |
@@ -312,9 +312,9 @@ bool PipelineImpl::IsStreaming() const { |
return streaming_; |
} |
-bool PipelineImpl::IsLoaded() const { |
+bool PipelineImpl::IsLocalSource() const { |
base::AutoLock auto_lock(lock_); |
- return loaded_; |
+ return local_source_; |
} |
PipelineStatistics PipelineImpl::GetStatistics() const { |
@@ -358,7 +358,7 @@ void PipelineImpl::ResetState() { |
buffered_time_ = kZero; |
buffered_bytes_ = 0; |
streaming_ = false; |
- loaded_ = false; |
+ local_source_ = false; |
total_bytes_ = 0; |
natural_size_.SetSize(0, 0); |
volume_ = 1.0f; |
@@ -555,6 +555,7 @@ void PipelineImpl::SetStreaming(bool streaming) { |
base::AutoLock auto_lock(lock_); |
streaming_ = streaming; |
+ download_rate_monitor_.set_streaming(streaming_); |
} |
void PipelineImpl::NotifyEnded() { |
@@ -564,17 +565,6 @@ void PipelineImpl::NotifyEnded() { |
media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::ENDED)); |
} |
-void PipelineImpl::SetLoaded(bool loaded) { |
- DCHECK(IsRunning()); |
- media_log_->AddEvent( |
- media_log_->CreateBooleanEvent( |
- MediaLogEvent::LOADED_SET, "loaded", loaded)); |
- |
- base::AutoLock auto_lock(lock_); |
- loaded_ = loaded; |
- download_rate_monitor_.set_loaded(loaded_); |
-} |
- |
void PipelineImpl::SetNetworkActivity(bool is_downloading_data) { |
DCHECK(IsRunning()); |
@@ -1044,8 +1034,11 @@ void PipelineImpl::FilterStateTransitionTask() { |
// Start monitoring rate of downloading. |
int bitrate = 0; |
- if (demuxer_.get()) |
+ if (demuxer_.get()) { |
bitrate = demuxer_->GetBitrate(); |
+ local_source_ = demuxer_->IsLocalSource(); |
+ download_rate_monitor_.set_local_source(local_source_); |
acolwell GONE FROM CHROMIUM
2011/11/30 19:26:11
Consider making local_source a parameter of the St
vrk (LEFT CHROMIUM)
2011/12/01 02:11:35
Done.
|
+ } |
// Needs to be locked because most other calls to |download_rate_monitor_| |
// occur on the renderer thread. |
download_rate_monitor_.Start( |