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

Unified Diff: media/filters/chunk_demuxer_unittest.cc

Issue 312403002: Fix crashes caused when SourceBuffer.remove() is called starting at the presentation duration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comments. Created 6 years, 6 months 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/chunk_demuxer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer_unittest.cc
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc
index 67928e373afb7e2551613496d22343aa77317f52..6dd7192d4af8d69382c8cb1c83df9e93736f9fc3 100644
--- a/media/filters/chunk_demuxer_unittest.cc
+++ b/media/filters/chunk_demuxer_unittest.cc
@@ -3269,6 +3269,25 @@ TEST_P(ChunkDemuxerTest, Remove_AudioVideoText) {
CheckExpectedBuffers(text_stream, "1 101 201");
}
+TEST_P(ChunkDemuxerTest, Remove_StartAtDuration) {
+ ASSERT_TRUE(InitDemuxer(HAS_AUDIO));
+ DemuxerStream* audio_stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+
+ AppendSingleStreamCluster(kSourceId, kAudioTrackNum,
+ "0K 20K 40K 60K 80K 100K 120K 140K");
+
+ CheckExpectedRanges(kSourceId, "{ [0,160) }");
+ CheckExpectedBuffers(audio_stream, "0 20 40 60 80 100 120 140");
+
+ demuxer_->Remove(kSourceId,
+ base::TimeDelta::FromSecondsD(demuxer_->GetDuration()),
wolenetz 2014/06/05 23:27:32 demuxer_->GetDuration() will be much larger than 1
acolwell GONE FROM CHROMIUM 2014/06/06 00:40:07 Done.
+ kInfiniteDuration());
+
+ Seek(base::TimeDelta());
+ CheckExpectedRanges(kSourceId, "{ [0,160) }");
+ CheckExpectedBuffers(audio_stream, "0 20 40 60 80 100 120 140");
+}
+
// Verifies that a Seek() will complete without text cues for
// the seek point and will return cues after the seek position
// when they are eventually appended.
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698