Commit a002534f authored by acolwell@chromium.org's avatar acolwell@chromium.org

Fix last_range != range_for_next_append_ DCHECK in SourceBufferStream.

Added a condition to avoid the DCHECK for a valid situation where the
check should have been applied.. A test was added to capture the
specific case that was triggering the DCHECK.

BUG=303413
TEST=SourceBufferStreamTest.Remove_PreviousAppendDestroyedAndOverwriteExistingRange

Review URL: https://codereview.chromium.org/58663003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232998 0039d316-1c4b-4281-b951-d872f2087c98
parent c50d710c
......@@ -391,7 +391,7 @@ void SourceBufferStream::OnNewMediaSegment(
media_segment_start_time)) {
last_appended_buffer_timestamp_ = kNoTimestamp();
last_appended_buffer_is_keyframe_ = false;
} else {
} else if (last_range != ranges_.end()) {
DCHECK(last_range == range_for_next_append_);
}
}
......
......@@ -3225,6 +3225,31 @@ TEST_F(SourceBufferStreamTest, Remove_GOPBeingAppended) {
CheckExpectedBuffers("240K 270 300");
}
TEST_F(SourceBufferStreamTest,
Remove_PreviousAppendDestroyedAndOverwriteExistingRange) {
SeekToTimestamp(base::TimeDelta::FromMilliseconds(90));
NewSegmentAppend("90K 120 150");
CheckExpectedRangesByTimestamp("{ [90,180) }");
// Append a segment before the previously appended data.
NewSegmentAppend("0K 30 60");
// Verify that the ranges get merged.
CheckExpectedRangesByTimestamp("{ [0,180) }");
// Remove the data from the last append.
RemoveInMs(0, 90, 360);
CheckExpectedRangesByTimestamp("{ [90,180) }");
// Append a new segment that follows the removed segment and
// starts at the beginning of the range left over from the
// remove.
NewSegmentAppend("90K 121 151");
CheckExpectedBuffers("90K 121 151");
}
// TODO(vrk): Add unit tests where keyframes are unaligned between streams.
// (crbug.com/133557)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment