diff --git a/libavformat/utils.c b/libavformat/utils.c index bf8abeec68..dce34449ba 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -779,7 +779,7 @@ static int get_audio_frame_size(AVCodecContext *enc, int size) frame_size = (size << 3) / (bits_per_sample * enc->channels); } else { /* used for example by ADPCM codecs */ - if (enc->bit_rate == 0) + if (enc->bit_rate == 0 || determinable_frame_size(enc)) return -1; frame_size = ((int64_t)size * 8 * enc->sample_rate) / enc->bit_rate; } diff --git a/tests/ref/fate/wtv-demux b/tests/ref/fate/wtv-demux index d20d041432..fadc4ef20d 100644 --- a/tests/ref/fate/wtv-demux +++ b/tests/ref/fate/wtv-demux @@ -1,11 +1,11 @@ #tb 0: 1/10000000 #tb 1: 1/10000000 -1, -2, -2, 180000, 576, 0x9b6e1638 -1, 179998, 179998, 240000, 576, 0x0ca91183 -1, 419998, 419998, 240000, 576, 0xec6a180f -1, 659998, 659998, 240000, 576, 0x478a2b9b -1, 899998, 899998, 240000, 576, 0x00fa15b3 -1, 1139998, 1139998, 240000, 576, 0xfb551816 +1, -2, -2, 240000, 576, 0x9b6e1638 +1, 239998, 239998, 240000, 576, 0x0ca91183 +1, 479998, 479998, 240000, 576, 0xec6a180f +1, 719998, 719998, 240000, 576, 0x478a2b9b +1, 959998, 959998, 240000, 576, 0x00fa15b3 +1, 1199998, 1199998, 240000, 576, 0xfb551816 1, 1439998, 1439998, 240000, 576, 0x422e12bd 1, 1679998, 1679998, 240000, 576, 0xa7581b29 1, 1919998, 1919998, 240000, 576, 0xd4b31a74