diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-02-03 01:37:21 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-02-04 17:54:13 +0100 |
commit | 89e2fbceee0b7b71d86dc32b0f3dad1864fa018f (patch) | |
tree | b4ca4dc5035697c547ef4a92b50171c0f5ffd850 /libavcodec/utils.c | |
parent | 57651493923ea4bc76453aa18fb0ecad7926720d (diff) | |
download | ffmpeg-89e2fbceee0b7b71d86dc32b0f3dad1864fa018f.tar.gz |
avcodec/utils: unbreak BINKAUDIO_DCT duration calculation
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a1ae9cab18..4d1909b581 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1668,14 +1668,10 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba, return 256 * sr / 245; else if (id == AV_CODEC_ID_DST) return 588 * sr / 44100; - - if (ch > 0) { - /* calc from sample rate and channels */ - if (id == AV_CODEC_ID_BINKAUDIO_DCT) { - if (sr / 22050 > 22) - return 0; - return (480 << (sr / 22050)) / ch; - } + else if (id == AV_CODEC_ID_BINKAUDIO_DCT) { + if (sr / 22050 > 22) + return 0; + return (480 << (sr / 22050)); } if (id == AV_CODEC_ID_MP3) |