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

Unified Diff: media/filters/audio_decoder_unittest.cc

Issue 2378443002: Fix MSE ADTS parsing on Android. (Closed)
Patch Set: Address comments. Created 4 years, 3 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/BUILD.gn ('k') | media/formats/mp2t/es_parser_adts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_decoder_unittest.cc
diff --git a/media/filters/audio_decoder_unittest.cc b/media/filters/audio_decoder_unittest.cc
index 9a959daa2b9012c703c00bd1c065bed569bab32a..1978482102cf57c5de1d1bfa92a92abdde48dde1 100644
--- a/media/filters/audio_decoder_unittest.cc
+++ b/media/filters/audio_decoder_unittest.cc
@@ -38,7 +38,7 @@
#include "media/filters/android/media_codec_audio_decoder.h"
#if defined(USE_PROPRIETARY_CODECS)
-#include "media/formats/mpeg/adts_header_parser.h"
+#include "media/formats/mpeg/adts_stream_parser.h"
#endif
// Helper macro to skip the test if MediaCodec is not available.
@@ -204,9 +204,16 @@ class AudioDecoderTest : public testing::TestWithParam<DecoderTestData> {
// streams we need to extract it with a separate procedure.
if (GetParam().decoder_type == MEDIA_CODEC &&
GetParam().codec == kCodecAAC && config.extra_data().empty()) {
- size_t ignore_orig_sample_rate;
- ASSERT_TRUE(ParseAdtsHeader(packet.data, false, &config,
- &ignore_orig_sample_rate));
+ int sample_rate;
+ ChannelLayout channel_layout;
+ std::vector<uint8_t> extra_data;
+ ASSERT_GT(ADTSStreamParser().ParseFrameHeader(
+ packet.data, packet.size, nullptr, &sample_rate,
+ &channel_layout, nullptr, nullptr, &extra_data),
+ 0);
+ config.Initialize(kCodecAAC, kSampleFormatS16, channel_layout,
+ sample_rate, extra_data, Unencrypted(),
+ base::TimeDelta(), 0);
ASSERT_FALSE(config.extra_data().empty());
}
#endif
« no previous file with comments | « media/BUILD.gn ('k') | media/formats/mp2t/es_parser_adts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698