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

Unified Diff: media/filters/pipeline_integration_test.cc

Issue 278673003: Enable splice frames and partial appends for AAC; with test! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Update hash. Created 6 years, 7 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/pipeline_integration_test.cc
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc
index a0f505d8c48c9c4be200a01f8650bd52b6126859..3eec062ac34fb9094bcb5fed34edca6dc0eee936 100644
--- a/media/filters/pipeline_integration_test.cc
+++ b/media/filters/pipeline_integration_test.cc
@@ -919,24 +919,35 @@ TEST_P(PipelineIntegrationTest, MediaSource_ADTS) {
TEST_P(PipelineIntegrationTest, MediaSource_ADTS_TimestampOffset) {
MockMediaSource source("sfx.adts", kADTS, kAppendWholeFile, GetParam());
- StartPipelineWithMediaSource(&source);
+ StartHashedPipelineWithMediaSource(&source);
EXPECT_EQ(325, source.last_timestamp_offset().InMilliseconds());
+ // Trim off multiple frames off the beginning of the segment which will cause
+ // the first decoded frame to be incorrect if preroll isn't implemented.
+ const base::TimeDelta adts_preroll_duration =
+ base::TimeDelta::FromSecondsD(2.5 * 1024 / 44100);
+ const base::TimeDelta append_time =
+ source.last_timestamp_offset() - adts_preroll_duration;
+
scoped_refptr<DecoderBuffer> second_file = ReadTestDataFile("sfx.adts");
- source.AppendAtTime(
- source.last_timestamp_offset() - base::TimeDelta::FromMilliseconds(10),
- second_file->data(),
- second_file->data_size());
+ source.AppendAtTimeWithWindow(append_time,
+ append_time + adts_preroll_duration,
+ kInfiniteDuration(),
+ second_file->data(),
+ second_file->data_size());
source.EndOfStream();
- EXPECT_EQ(640, source.last_timestamp_offset().InMilliseconds());
+ EXPECT_EQ(592, source.last_timestamp_offset().InMilliseconds());
EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
- EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
+ EXPECT_EQ(592, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
Play();
EXPECT_TRUE(WaitUntilOnEnded());
+
+ // Verify preroll is stripped.
+ EXPECT_EQ("-0.06,0.97,-0.90,-0.70,-0.53,-0.34,", GetAudioHash());
}
TEST_F(PipelineIntegrationTest, BasicPlaybackHashed_MP3) {
« 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