This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 3a042a5ab847270f951465ea3eecb018e331b8d4
Author:     James Almer <[email protected]>
AuthorDate: Tue May 19 13:36:39 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Fri May 22 23:10:05 2026 +0000

    avcodec/libfdk-aacdec: support streams with more than six channels
    
    Before this change, the decoder was forcing downmixing everything to a max 
of
    six channels.
    Layouts 6.1(back), 7.1(wide), 7.1 and 5.1.2 (Channel Configurations 11, 7, 
12,
    and 14 respectively, as well as the equivalent PCE version) should be 
supported
    now.
    
    Signed-off-by: James Almer <[email protected]>
---
 libavcodec/libfdk-aacdec.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
index 9c597c24fc..8b57bb43cf 100644
--- a/libavcodec/libfdk-aacdec.c
+++ b/libavcodec/libfdk-aacdec.c
@@ -191,6 +191,9 @@ static int get_stream_info(AVCodecContext *avctx, AVFrame 
*frame)
     }
     if (channel_counts[ACT_BACK] > 0) {
         switch (channel_counts[ACT_BACK]) {
+        case 4:
+            ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_SIDE_LEFT 
| AV_CH_SIDE_RIGHT;
+            break;
         case 3:
             ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | 
AV_CH_BACK_CENTER;
             break;
@@ -218,6 +221,26 @@ static int get_stream_info(AVCodecContext *avctx, AVFrame 
*frame)
             ch_error = 1;
         }
     }
+    if (channel_counts[ACT_FRONT_TOP] > 0) {
+        switch (channel_counts[ACT_FRONT_TOP]) {
+        case 3:
+            ch_layout |= AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT |
+                         AV_CH_TOP_FRONT_CENTER;
+            break;
+        case 2:
+            ch_layout |= AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT;
+            break;
+        case 1:
+            ch_layout |= AV_CH_TOP_FRONT_CENTER;
+            break;
+        default:
+            av_log(avctx, AV_LOG_WARNING,
+                   "unsupported number of top front channels: %d\n",
+                   channel_counts[ACT_FRONT_TOP]);
+            ch_error = 1;
+            break;
+        }
+    }
 
     av_channel_layout_uninit(&avctx->ch_layout);
     av_channel_layout_from_mask(&avctx->ch_layout, ch_layout);
@@ -301,6 +324,12 @@ static av_cold int fdk_aac_decode_init(AVCodecContext 
*avctx)
                }
             }
         }
+#if FDKDEC_VER_AT_LEAST(2, 5)
+    } else {
+        // AAC_PCM_MAX_OUTPUT_CHANNELS == 0 means outputting all the coded 
channels
+        if (aacDecoder_SetParam(s->handle, AAC_PCM_MAX_OUTPUT_CHANNELS, 0) != 
AAC_DEC_OK)
+           av_log(avctx, AV_LOG_WARNING, "Unable to set output channels in the 
decoder\n");
+#endif
     }
 
     if (s->drc_boost != -1) {

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to