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

Unified Diff: media/base/pipeline_impl.cc

Issue 8625002: allow non-downloading pipeline to play without download rate monitoring. (Closed) Base URL: svn://chrome-svn/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
« 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/base/pipeline_impl.cc
===================================================================
--- media/base/pipeline_impl.cc (revision 111037)
+++ media/base/pipeline_impl.cc (working copy)
@@ -1046,12 +1046,18 @@
int bitrate = 0;
if (demuxer_.get())
bitrate = demuxer_->GetBitrate();
- // Needs to be locked because most other calls to |download_rate_monitor_|
- // occur on the renderer thread.
- download_rate_monitor_.Start(
- base::Bind(&PipelineImpl::OnCanPlayThrough, this), bitrate);
- download_rate_monitor_.SetBufferedBytes(buffered_bytes_, base::Time::Now());
+ if (bitrate == 0) {
+ OnCanPlayThrough();
+ } else {
+ // Needs to be locked because most other calls to |download_rate_monitor_|
+ // occur on the renderer thread.
+ download_rate_monitor_.Start(
+ base::Bind(&PipelineImpl::OnCanPlayThrough, this), bitrate);
+ download_rate_monitor_.SetBufferedBytes(buffered_bytes_,
+ base::Time::Now());
+ }
+
if (IsPipelineStopPending()) {
// We had a pending stop request need to be honored right now.
TearDownPipeline();
« 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