[FFmpeg-devel] [PATCH] libfdk-aacenc: disable hard version requirements

Timothy Gu timothygu99 at gmail.com
Thu Feb 6 01:08:00 CET 2014


Enable compilation on machines with an old libfdk-aac.

Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
---
 configure                  | 4 +---
 doc/encoders.texi          | 3 +++
 libavcodec/libfdk-aacenc.c | 6 ++++++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index c46bfd3..32bc5ba 100755
--- a/configure
+++ b/configure
@@ -4437,9 +4437,7 @@ enabled libcelt           && require libcelt celt/celt.h celt_decode -lcelt0 &&
                                die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
 enabled libcaca           && require_pkg_config caca caca.h caca_create_canvas
 enabled libfaac           && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
-enabled libfdk_aac        && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
-                             { check_cpp_condition fdk-aac/aacenc_lib.h "AACENCODER_LIB_VL0 >= 3 && AACENCODER_LIB_VL1 >= 4 && AACENCODER_LIB_VL2 >= 12" ||
-                               die "ERROR: libfdk-aac must be installed and version must be >= 0.1.3."; }
+enabled libfdk_aac        && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
 flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
 enabled libflite          && require2 libflite "flite/flite.h" flite_init $flite_libs
 enabled libfreetype       && require_libfreetype
diff --git a/doc/encoders.texi b/doc/encoders.texi
index d163440..c28cbcb 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -623,6 +623,9 @@ VBR encoding, enabled through the @option{vbr} or @option{flags
 +qscale} options, is experimental and only works with some
 combinations of parameters.
 
+Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
+higher.
+
 For more information see the fdk-aac project at
 @url{http://sourceforge.net/p/opencore-amr/fdk-aac/}.
 
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 2d91e58..44492a1 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -151,6 +151,9 @@ 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;
+/* The version macro is introduced the same time as the 7.1 support, so this
+   should suffice. */
+#ifdef (AACENCODER_LIB_VL0)
     case 8:
         sce = 2;
         cpe = 3;
@@ -161,6 +164,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
             mode = MODE_7_1_FRONT_CENTER;
         }
         break;
+#endif
     default:
         av_log(avctx, AV_LOG_ERROR,
                "Unsupported number of channels %d\n", avctx->channels);
@@ -394,8 +398,10 @@ static const uint64_t aac_channel_layout[] = {
     AV_CH_LAYOUT_4POINT0,
     AV_CH_LAYOUT_5POINT0_BACK,
     AV_CH_LAYOUT_5POINT1_BACK,
+#ifdef AACENCODER_LIB_VL0
     AV_CH_LAYOUT_7POINT1_WIDE_BACK,
     AV_CH_LAYOUT_7POINT1,
+#endif
     0,
 };
 
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list