diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 02:17:53 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 02:17:53 +0000 |
commit | 08a78639c036ebe4152a9e901a7bfdb41beda7d0 (patch) | |
tree | e588230a7f66fd9469fd85f7874d8cb84fd9aa5b /webkit/media/buffered_data_source.h | |
parent | efcde1301756eb49e85640e488d350f7bdf46df2 (diff) | |
download | chromium_src-08a78639c036ebe4152a9e901a7bfdb41beda7d0.zip chromium_src-08a78639c036ebe4152a9e901a7bfdb41beda7d0.tar.gz chromium_src-08a78639c036ebe4152a9e901a7bfdb41beda7d0.tar.bz2 |
Track buffered byte ranges correctly in media::Pipeline.
Previously, the interaction was:
BufferedDataSource: hey Pipeline, I just read byte X
Pipeline: cool story bro! I'll just pretend you've read every single byte from 0 to X.
Now the interaction is:
BufferedDataSource: hey Pipeline, I just read bytes X-Y
Pipeline: neato! I'll just add that range to my list of buffered ranges.
The most noticeable outcome of this change is that seeking in a media format that requires reading a seek index from the end of the file (e.g. WebM w/ CUES at the end) no longer results in an almost-instant claim of having buffered the entire video just because a seek was completed (esp. dramatic when viewing a very large file, such as a multi-hour video).
BUG=103513,127355
TEST=besides unittests, this allows a cleaned-up version of http/tests/media/video-buffered.html to be un-SKIPped!
Review URL: https://chromiumcodereview.appspot.com/10451049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/media/buffered_data_source.h')
-rw-r--r-- | webkit/media/buffered_data_source.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/webkit/media/buffered_data_source.h b/webkit/media/buffered_data_source.h index e092c25..fd97592 100644 --- a/webkit/media/buffered_data_source.h +++ b/webkit/media/buffered_data_source.h @@ -165,9 +165,10 @@ class BufferedDataSource : public media::DataSource { // Read parameters received from the Read() method call. media::DataSource::ReadCB read_cb_; - int64 read_position_; int read_size_; uint8* read_buffer_; + // Retained between reads to make sense of buffering information. + int64 last_read_start_; // This buffer is intermediate, we use it for BufferedResourceLoader to write // to. And when read in BufferedResourceLoader is done, we copy data from |