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

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 2645953004: Update duration when demuxed packets exceed known duration. (Closed)
Patch Set: Remove broken CGI server. Rate limit duration changed events. Created 3 years, 11 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') | media/test/pipeline_integration_test.cc » ('j') | 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 6699a93b1c28eceeac8e7e56b6a72ee0e18254db..c96883f70c3973ef02e3ce5a837844cc7511a604 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -111,7 +111,7 @@ class FFmpegDemuxerTest : public testing::Test {
media::PipelineStatus expected_pipeline_status,
base::Time timeline_offset) {
if (expected_pipeline_status == PIPELINE_OK)
- EXPECT_CALL(host_, SetDuration(_));
+ EXPECT_CALL(host_, SetDuration(_)).Times(AnyNumber());
WaitableMessageLoopEvent event;
demuxer_->Initialize(&host_, event.GetPipelineStatusCB(), enable_text);
demuxer_->timeline_offset_ = timeline_offset;
@@ -223,8 +223,10 @@ class FFmpegDemuxerTest : public testing::Test {
}
// Accessor to demuxer internals.
- void set_duration_known(bool duration_known) {
+ void SetDurationKnown(bool duration_known) {
demuxer_->duration_known_ = duration_known;
+ if (!duration_known)
+ demuxer_->duration_ = kInfiniteDuration;
}
bool IsStreamStopped(DemuxerStream::Type type) {
@@ -815,8 +817,8 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration) {
// Verify that end of stream buffers are created.
CreateDemuxer("bear-320x240.webm");
InitializeDemuxer();
- set_duration_known(false);
- EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767)));
+ SetDurationKnown(false);
+ EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2744)));
ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO));
}
@@ -825,8 +827,8 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_VideoOnly) {
// Verify that end of stream buffers are created.
CreateDemuxer("bear-320x240-video-only.webm");
InitializeDemuxer();
- set_duration_known(false);
- EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2736)));
+ SetDurationKnown(false);
+ EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2703)));
ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO));
}
@@ -834,8 +836,8 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_AudioOnly) {
// Verify that end of stream buffers are created.
CreateDemuxer("bear-320x240-audio-only.webm");
InitializeDemuxer();
- set_duration_known(false);
- EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767)));
+ SetDurationKnown(false);
+ EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2744)));
ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
}
@@ -844,8 +846,8 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_UnsupportedStream) {
// if there are streams in the file that we don't support.
CreateDemuxer("vorbis_audio_wmv_video.mkv");
InitializeDemuxer();
- set_duration_known(false);
- EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(1014)));
+ SetDurationKnown(false);
+ EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(991)));
chcunningham 2017/01/27 21:41:13 I'm confused about why the durations came down her
DaleCurtis 2017/01/27 21:50:56 I'm not sure, I spot checked a couple of the files
ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
}
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698