diff options
author | James Almer <jamrial@gmail.com> | 2022-11-29 14:55:33 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-11-29 14:56:40 -0300 |
commit | 39dc9a7421ca5592f78703a8b3a336878d3965ce (patch) | |
tree | 51e1c160a2788c75fbbc4e2c0bc01cf2bf820bce | |
parent | 3d96775f9e56a9de6f5dd728a3297036a721ce0e (diff) | |
download | ffmpeg-39dc9a7421ca5592f78703a8b3a336878d3965ce.tar.gz |
avcodec/libfdk-aacenc: fix version check for the new channel layouts
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/libfdk-aacenc.c | 18 |
1 files 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 }, |