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

Unified Diff: media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc

Issue 2705353002: Fix mpeg-1 layer2 parsing typo. (Closed)
Patch Set: Created 3 years, 10 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/formats/mpeg/mpeg1_audio_stream_parser.cc ('k') | media/test/data/sfx.mp2 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc
diff --git a/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc b/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc
index bfa80217a8f53d58933c2d9104e118b73ac959a6..1def645120ab7914d6a226d6d77e915c1c719a0d 100644
--- a/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc
+++ b/media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc
@@ -48,6 +48,28 @@ TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend) {
EXPECT_GT(last_audio_config().codec_delay(), 0);
}
+// Test parsing with small prime sized chunks to smoke out "power of
+// 2" field size assumptions.
chcunningham 2017/02/22 00:49:04 Is this just theoretical? I'm not aware of any pow
DaleCurtis 2017/02/22 00:53:11 Yes I think it's just theoretical, but that's how
chcunningham 2017/02/22 01:13:48 Sorry, missed that. Your first segment isn't prime
DaleCurtis 2017/02/22 01:20:14 Done.
+TEST_F(MPEG1AudioStreamParserTest, UnalignedAppendMP2) {
+ const std::string expected =
+ "NewSegment"
+ "{ 0K }"
+ "{ 0K }"
chcunningham 2017/02/22 00:49:03 Why are the timestamps not increasing?
DaleCurtis 2017/02/22 00:53:11 Timestamps restart per append; so the small append
chcunningham 2017/02/22 01:13:48 Ah, yeah. timestampOffset gets updated at the boun
+ "{ 0K }"
+ "{ 0K }"
+ "EndOfSegment"
+ "NewSegment"
+ "{ 0K }"
+ "{ 0K }"
+ "{ 0K }"
+ "{ 0K }"
+ "{ 0K }"
+ "{ 0K }"
+ "EndOfSegment";
+ EXPECT_EQ(expected, ParseFile("sfx.mp2", 17));
+ EXPECT_GT(last_audio_config().codec_delay(), 0);
+}
+
// Test parsing with a larger piece size to verify that multiple buffers
// are passed to |new_buffer_cb_|.
TEST_F(MPEG1AudioStreamParserTest, UnalignedAppend512) {
« no previous file with comments | « media/formats/mpeg/mpeg1_audio_stream_parser.cc ('k') | media/test/data/sfx.mp2 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698