summaryrefslogtreecommitdiffstats
path: root/webkit/media/buffered_data_source.cc
diff options
context:
space:
mode:
authorvrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 19:52:08 +0000
committervrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 19:52:08 +0000
commit7b268b7a549561344b59da31d58cbe3c6ca71dd8 (patch)
treeb93d5a298c4e40b896026ed02a28efb999701d35 /webkit/media/buffered_data_source.cc
parent49d633905b2467796aa6a4794f64001664358334 (diff)
downloadchromium_src-7b268b7a549561344b59da31d58cbe3c6ca71dd8.zip
chromium_src-7b268b7a549561344b59da31d58cbe3c6ca71dd8.tar.gz
chromium_src-7b268b7a549561344b59da31d58cbe3c6ca71dd8.tar.bz2
Fire canplaythrough event at the proper time for audio/video
In this CL, the browser fires the canplaythrough event based on an approximation of the download speed of the media instead of firing the event right away. BUG=73609 TEST=NONE Review URL: http://codereview.chromium.org/8399023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media/buffered_data_source.cc')
-rw-r--r--webkit/media/buffered_data_source.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/webkit/media/buffered_data_source.cc b/webkit/media/buffered_data_source.cc
index 01d4675..a1ea024 100644
--- a/webkit/media/buffered_data_source.cc
+++ b/webkit/media/buffered_data_source.cc
@@ -606,8 +606,10 @@ void BufferedDataSource::ReadCallback(int error) {
// fail like they would if we had known the file size at the beginning.
total_bytes_ = loader_->instance_size();
- if (host() && total_bytes_ != kPositionNotSpecified)
+ if (host() && total_bytes_ != kPositionNotSpecified) {
host()->SetTotalBytes(total_bytes_);
+ host()->SetBufferedBytes(total_bytes_);
+ }
}
DoneRead_Locked(error);
}
@@ -661,12 +663,12 @@ void BufferedDataSource::UpdateHostState_Locked() {
filter_host->SetLoaded(loaded_);
- if (streaming_) {
+ if (streaming_)
filter_host->SetStreaming(true);
- } else {
+
+ if (total_bytes_ != kPositionNotSpecified)
filter_host->SetTotalBytes(total_bytes_);
- filter_host->SetBufferedBytes(buffered_bytes_);
- }
+ filter_host->SetBufferedBytes(buffered_bytes_);
}
} // namespace webkit_media