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

Unified Diff: webkit/media/buffered_data_source.cc

Issue 8399023: Fire canplaythrough event at the proper time for audio/video (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
« no previous file with comments | « media/media.gyp ('k') | webkit/media/buffered_data_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/buffered_data_source.cc
diff --git a/webkit/media/buffered_data_source.cc b/webkit/media/buffered_data_source.cc
index 01d4675b206c74d448e1e5fe7a3ef4c9c228bf99..a1ea024c3a275eb5ab9fb38a91ba8968d25eca0e 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
« no previous file with comments | « media/media.gyp ('k') | webkit/media/buffered_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698