summaryrefslogtreecommitdiffstats
path: root/media/base/pipeline_unittest.cc
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 02:17:53 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 02:17:53 +0000
commit08a78639c036ebe4152a9e901a7bfdb41beda7d0 (patch)
treee588230a7f66fd9469fd85f7874d8cb84fd9aa5b /media/base/pipeline_unittest.cc
parentefcde1301756eb49e85640e488d350f7bdf46df2 (diff)
downloadchromium_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 'media/base/pipeline_unittest.cc')
-rw-r--r--media/base/pipeline_unittest.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc
index 888b962..6679421 100644
--- a/media/base/pipeline_unittest.cc
+++ b/media/base/pipeline_unittest.cc
@@ -477,7 +477,7 @@ TEST_F(PipelineTest, GetBufferedTimeRanges) {
EXPECT_EQ(0u, pipeline_->GetBufferedTimeRanges().size());
- pipeline_->SetBufferedBytes(kTotalBytes / 8);
+ pipeline_->AddBufferedByteRange(0, kTotalBytes / 8);
EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(base::TimeDelta(), pipeline_->GetBufferedTimeRanges().start(0));
EXPECT_EQ(kDuration / 8, pipeline_->GetBufferedTimeRanges().end(0));
@@ -486,7 +486,8 @@ TEST_F(PipelineTest, GetBufferedTimeRanges) {
ExpectSeek(kSeekTime);
DoSeek(kSeekTime);
- pipeline_->SetBufferedBytes(kTotalBytes / 2 + kTotalBytes / 8);
+ pipeline_->AddBufferedByteRange(kTotalBytes / 2,
+ kTotalBytes / 2 + kTotalBytes / 8);
EXPECT_EQ(2u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(base::TimeDelta(), pipeline_->GetBufferedTimeRanges().start(0));
EXPECT_EQ(kDuration / 8, pipeline_->GetBufferedTimeRanges().end(0));