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

Unified Diff: media/filters/source_buffer_stream_unittest.cc

Issue 51983002: Update selected range after truncation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 7 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/filters/source_buffer_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_stream_unittest.cc
diff --git a/media/filters/source_buffer_stream_unittest.cc b/media/filters/source_buffer_stream_unittest.cc
index 8d66adc97c6e7b1302e8e66a03e144559439d287..ef3ca7342d607799f35b740b35b1c555dcec637f 100644
--- a/media/filters/source_buffer_stream_unittest.cc
+++ b/media/filters/source_buffer_stream_unittest.cc
@@ -2864,6 +2864,31 @@ TEST_F(SourceBufferStreamTest, SetExplicitDuration_DeletePartialSelectedRange) {
CheckExpectedRanges("{ [0,4) [10,10) }");
}
+// Test the case where duration is set while the stream parser buffers
+// already start passing the data to decoding pipeline. Selected range,
+// when invalidated by getting truncated, should be updated to NULL
+// accordingly so that successive append operations keep working.
+TEST_F(SourceBufferStreamTest, SetExplicitDuration_UpdateSelectedRange) {
+ // Seek to start of stream.
+ SeekToTimestamp(base::TimeDelta::FromMilliseconds(0));
+
+ NewSegmentAppend("0K 30 60 90");
+
+ // Read out the first few buffers.
+ CheckExpectedBuffers("0K 30");
+
+ // Set duration to be right before buffer 1.
+ stream_->OnSetDuration(base::TimeDelta::FromMilliseconds(60));
+
+ // Verify that there is no next buffer.
+ CheckNoNextBuffer();
+
+ // We should be able to append new buffers at this point.
+ NewSegmentAppend("120K 150");
+
+ CheckExpectedRangesByTimestamp("{ [0,60) [120,180) }");
+}
+
// Test the case were the current playback position is at the end of the
// buffered data and several overlaps occur that causes the selected
// range to get split and then merged back into a single range.
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698