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

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 353563002: Fix corrupted audio and video at playback start in ogg containers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove file code. 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/ffmpeg_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/ffmpeg_demuxer_unittest.cc
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index 2cfcee225359eae6a9379da797f9de0d3c895e4c..638aa0c4fa51e8d5a65fc68e52a21da94398da73 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -489,30 +489,86 @@ TEST_F(FFmpegDemuxerTest, Read_AudioNoStartTime) {
}
}
-TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard) {
+// TODO(dalecurtis): Test is disabled since FFmpeg does not currently guarantee
+// the order of demuxed packets in OGG containers. Re-enable once we decide to
+// either workaround it or attempt a fix upstream. See http://crbug.com/387996.
+TEST_F(FFmpegDemuxerTest,
+ DISABLED_Read_AudioNegativeStartTimeAndOggDiscard_Bear) {
// Many ogg files have negative starting timestamps, so ensure demuxing and
// seeking work correctly with a negative start time.
CreateDemuxer("bear.ogv");
InitializeDemuxer();
+ // Attempt a read from the video stream and run the message loop until done.
+ DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+
// Run the test twice with a seek in between.
for (int i = 0; i < 2; ++i) {
- demuxer_->GetStream(DemuxerStream::AUDIO)->Read(
+ audio->Read(
NewReadCBWithCheckedDiscard(FROM_HERE, 40, 0, kInfiniteDuration()));
message_loop_.Run();
- demuxer_->GetStream(DemuxerStream::AUDIO)->Read(
+ audio->Read(
NewReadCBWithCheckedDiscard(FROM_HERE, 41, 2903, kInfiniteDuration()));
message_loop_.Run();
- demuxer_->GetStream(DemuxerStream::AUDIO)->Read(NewReadCBWithCheckedDiscard(
+ audio->Read(NewReadCBWithCheckedDiscard(
FROM_HERE, 173, 5805, base::TimeDelta::FromMicroseconds(10159)));
message_loop_.Run();
- demuxer_->GetStream(DemuxerStream::AUDIO)
- ->Read(NewReadCB(FROM_HERE, 148, 18866));
+ audio->Read(NewReadCB(FROM_HERE, 148, 18866));
message_loop_.Run();
EXPECT_EQ(base::TimeDelta::FromMicroseconds(-15964),
demuxer_->start_time());
+ video->Read(NewReadCB(FROM_HERE, 5751, 0));
+ message_loop_.Run();
+
+ video->Read(NewReadCB(FROM_HERE, 846, 33367));
+ message_loop_.Run();
+
+ video->Read(NewReadCB(FROM_HERE, 1255, 66733));
+ message_loop_.Run();
+
+ // Seek back to the beginning and repeat the test.
+ WaitableMessageLoopEvent event;
+ demuxer_->Seek(base::TimeDelta(), event.GetPipelineStatusCB());
+ event.RunAndWaitForStatus(PIPELINE_OK);
+ }
+}
+
+// Same test above, but using sync2.ogv which has video stream muxed before the
+// audio stream, so seeking based only on start time will fail since ffmpeg is
+// essentially just seeking based on file position.
+TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard_Sync) {
+ // Many ogg files have negative starting timestamps, so ensure demuxing and
+ // seeking work correctly with a negative start time.
+ CreateDemuxer("sync2.ogv");
+ InitializeDemuxer();
+
+ // Attempt a read from the video stream and run the message loop until done.
+ DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+
+ // Run the test twice with a seek in between.
+ for (int i = 0; i < 2; ++i) {
+ audio->Read(NewReadCBWithCheckedDiscard(
+ FROM_HERE, 1, 0, base::TimeDelta::FromMicroseconds(2902)));
+ message_loop_.Run();
+
+ audio->Read(NewReadCB(FROM_HERE, 1, 2902));
+ message_loop_.Run();
+ EXPECT_EQ(base::TimeDelta::FromMicroseconds(-2902),
+ demuxer_->start_time());
+
+ video->Read(NewReadCB(FROM_HERE, 9997, 0));
+ message_loop_.Run();
+
+ video->Read(NewReadCB(FROM_HERE, 16, 33241));
+ message_loop_.Run();
+
+ video->Read(NewReadCB(FROM_HERE, 631, 66482));
+ message_loop_.Run();
+
// Seek back to the beginning and repeat the test.
WaitableMessageLoopEvent event;
demuxer_->Seek(base::TimeDelta(), event.GetPipelineStatusCB());
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698