diff mbox series

[FFmpeg-devel,2/2] avcodec/utils: unbreak BINKAUDIO_DCT duration calculation

Message ID 20210203004027.10772-2-onemda@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,1/2] avformat: add binka demuxer | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Paul B Mahol Feb. 3, 2021, 12:40 a.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/utils.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

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)