| Index: media/ffmpeg/ffmpeg_common_unittest.cc
|
| diff --git a/media/ffmpeg/ffmpeg_common_unittest.cc b/media/ffmpeg/ffmpeg_common_unittest.cc
|
| index aa8a06d9de7d9b90657ca2cd542ba487b83a7619..9a735872cf3ca4fb796bc1292414870bcd35a94d 100644
|
| --- a/media/ffmpeg/ffmpeg_common_unittest.cc
|
| +++ b/media/ffmpeg/ffmpeg_common_unittest.cc
|
| @@ -161,17 +161,24 @@ TEST_F(FFmpegCommonTest, VerifyFormatSizes) {
|
| for (AVSampleFormat format = AV_SAMPLE_FMT_NONE;
|
| format < AV_SAMPLE_FMT_NB;
|
| format = static_cast<AVSampleFormat>(format + 1)) {
|
| - SampleFormat sample_format = AVSampleFormatToSampleFormat(format);
|
| - if (sample_format == kUnknownSampleFormat) {
|
| - // This format not supported, so skip it.
|
| - continue;
|
| + std::vector<AVCodecID> codec_ids(1, AV_CODEC_ID_NONE);
|
| + if (format == AV_SAMPLE_FMT_S32)
|
| + codec_ids.push_back(AV_CODEC_ID_PCM_S24LE);
|
| + for (const auto& codec_id : codec_ids) {
|
| + SampleFormat sample_format =
|
| + AVSampleFormatToSampleFormat(format, codec_id);
|
| + if (sample_format == kUnknownSampleFormat) {
|
| + // This format not supported, so skip it.
|
| + continue;
|
| + }
|
| +
|
| + // Have FFMpeg compute the size of a buffer of 1 channel / 1 frame
|
| + // with 1 byte alignment to make sure the sizes match.
|
| + int single_buffer_size =
|
| + av_samples_get_buffer_size(NULL, 1, 1, format, 1);
|
| + int bytes_per_channel = SampleFormatToBytesPerChannel(sample_format);
|
| + EXPECT_EQ(bytes_per_channel, single_buffer_size);
|
| }
|
| -
|
| - // Have FFMpeg compute the size of a buffer of 1 channel / 1 frame
|
| - // with 1 byte alignment to make sure the sizes match.
|
| - int single_buffer_size = av_samples_get_buffer_size(NULL, 1, 1, format, 1);
|
| - int bytes_per_channel = SampleFormatToBytesPerChannel(sample_format);
|
| - EXPECT_EQ(bytes_per_channel, single_buffer_size);
|
| }
|
| }
|
|
|
|
|