[FFmpeg-cvslog] avcodec/libfdk-aacenc: fix version check for the new channel layouts

James Almer git at videolan.org
Tue Nov 29 19:58:14 EET 2022


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Nov 29 14:55:33 2022 -0300| [39dc9a7421ca5592f78703a8b3a336878d3965ce] | committer: James Almer

avcodec/libfdk-aacenc: fix version check for the new channel layouts

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=39dc9a7421ca5592f78703a8b3a336878d3965ce
---

 libavcodec/libfdk-aacenc.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 4aaeb1aeaa..54549de473 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -187,17 +187,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
     case 4: mode = MODE_1_2_1;   sce = 2; cpe = 1; break;
     case 5: mode = MODE_1_2_2;   sce = 1; cpe = 2; break;
     case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break;
+#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
+    case 7: mode = MODE_6_1;     sce = 3; cpe = 2; break;
+#endif
 /* The version macro is introduced the same time as the 7.1 support, so this
    should suffice. */
 #if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12
-    case 7: mode = MODE_6_1;     sce = 3; cpe = 2; break;
     case 8:
         sce = 2;
         cpe = 3;
         if (!av_channel_layout_compare(&avctx->ch_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1)) {
             mode = MODE_7_1_REAR_SURROUND;
+#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
         } else if (!av_channel_layout_compare(&avctx->ch_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK)) {
             mode = MODE_7_1_TOP_FRONT;
+#endif
         } else {
             // MODE_1_2_2_2_1 and MODE_7_1_FRONT_CENTER use the same channel layout
             mode = MODE_7_1_FRONT_CENTER;
@@ -451,10 +455,14 @@ static const uint64_t aac_channel_layout[] = {
     AV_CH_LAYOUT_4POINT0,
     AV_CH_LAYOUT_5POINT0_BACK,
     AV_CH_LAYOUT_5POINT1_BACK,
-#if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12
+#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
     AV_CH_LAYOUT_6POINT1_BACK,
+#endif
+#if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12
     AV_CH_LAYOUT_7POINT1_WIDE_BACK,
     AV_CH_LAYOUT_7POINT1,
+#endif
+#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
     AV_CH_LAYOUT_7POINT1_TOP_BACK,
 #endif
     0,
@@ -468,10 +476,14 @@ static const AVChannelLayout aac_ch_layouts[16] = {
     AV_CHANNEL_LAYOUT_4POINT0,
     AV_CHANNEL_LAYOUT_5POINT0_BACK,
     AV_CHANNEL_LAYOUT_5POINT1_BACK,
-#ifdef AACENCODER_LIB_VL0
+#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
     AV_CHANNEL_LAYOUT_6POINT1_BACK,
+#endif
+#if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12
     AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK,
     AV_CHANNEL_LAYOUT_7POINT1,
+#endif
+#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
     AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK,
 #endif
     { 0 },



More information about the ffmpeg-cvslog mailing list