]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/aac_ac3_parser: fix channel information parsing in case decoder is disabled
authorPiotr Uracz <puracz@vewd.com>
Mon, 25 Jan 2021 11:04:36 +0000 (12:04 +0100)
committerPaul B Mahol <onemda@gmail.com>
Mon, 1 Feb 2021 17:02:11 +0000 (18:02 +0100)
Fixes #7372

libavcodec/aac_ac3_parser.c

index e5d4b53339000ce657f23591ee497bb13bb4453b..e84d30aea22ff74963892b997d1939746c8861db 100644 (file)
@@ -89,7 +89,7 @@ get_next:
            the frame). */
         if (avctx->codec_id != AV_CODEC_ID_AAC) {
             avctx->sample_rate = s->sample_rate;
-            if (avctx->codec_id != AV_CODEC_ID_EAC3) {
+            if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) {
                 avctx->channels = s->channels;
                 avctx->channel_layout = s->channel_layout;
             }
@@ -99,7 +99,7 @@ get_next:
 
         /* Calculate the average bit rate */
         s->frame_number++;
-        if (avctx->codec_id != AV_CODEC_ID_EAC3) {
+        if (!CONFIG_EAC3_DECODER || avctx->codec_id != AV_CODEC_ID_EAC3) {
             avctx->bit_rate +=
                 (s->bit_rate - avctx->bit_rate) / s->frame_number;
         }