summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-25 01:08:13 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-25 01:08:13 +0000
commit1de1bfe314bb8c48b3e508f5001927988588fcf6 (patch)
treee6ce56cbabdcd4420b16c4dd9e9707205c5619f1 /configure.ac
parent63a62a45142380d67db3d2d5cb57891b2c9371e7 (diff)
fix and detect differences between faad2 1.1 and 2.0
git-svn-id: https://svn.musicpd.org/mpd/trunk@459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac66
1 files changed, 65 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 9c695a254..e2b5f16f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -278,13 +278,77 @@ if test x$enable_aac = xyes; then
CPPFLAGS=$CFLAGS
AC_CHECK_HEADER(faad.h,,enable_aac=no)
if test x$enable_aac = xyes; then
+ AC_CHECK_DECL(FAAD2_VERSION,,enable_aac=no,[#include <faad.h>])
+ fi
+ if test x$enable_aac = xyes; then
AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include <faad.h>])
fi
if test x$enable_aac = xyes; then
AC_CHECK_LIB(faad,faacDecInit2,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no)
fi
if test x$enable_aac = xyes; then
- AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR],,,[#include <faad.h>])
+ AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen)
+ AC_COMPILE_IFELSE([
+#include <faad.h>
+
+int main() {
+ char buffer;
+ long bufferlen = 0;
+ faacDecHandle decoder;
+ faacDecFrameInfo frameInfo;
+ faacDecConfigurationPtr config;
+ unsigned char channels;
+ long sampleRate;
+ mp4AudioSpecificConfig mp4ASC;
+
+ decoder = faacDecOpen();
+ config = faacDecGetCurrentConfiguration(decoder);
+ config->outputFormat = FAAD_FMT_16BIT;
+ faacDecSetConfiguration(decoder,config);
+ AudioSpecificConfig(&buffer, bufferlen, &mp4ASC);
+ faacDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels);
+ faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
+ faacDecDecode(decoder,&frameInfo,&buffer,bufferlen);
+
+ return 0;
+}
+],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FAAD_BUFLEN_FUNCS,1,[Define if FAAD2 uses buflen in function calls])],[AC_MSG_RESULT(no);
+ AC_MSG_CHECKING(that FAAD2 can even be used)
+ AC_COMPILE_IFELSE([
+#include <faad.h>
+
+int main() {
+ char buffer;
+ faacDecHandle decoder;
+ faacDecFrameInfo frameInfo;
+ faacDecConfigurationPtr config;
+ unsigned char channels;
+ long sampleRate;
+ long bufferlen = 0;
+ unsigned long dummy1_32;
+ unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
+ dummy7_8, dummy8_8;
+
+ decoder = faacDecOpen();
+ config = faacDecGetCurrentConfiguration(decoder);
+ config->outputFormat = FAAD_FMT_16BIT;
+ faacDecSetConfiguration(decoder,config);
+ AudioSpecificConfig(&buffer,&dummy1_32,&dummy2_8,
+ &dummy3_8,&dummy4_8,&dummy5_8,
+ &dummy6_8,&dummy7_8,&dummy8_8);
+ faacDecInit(decoder,&buffer,&sampleRate,&channels);
+ faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels);
+ faacDecDecode(decoder,&frameInfo,&buffer);
+ faacDecClose(decoder);
+
+ return 0;
+}
+],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no])
+ ])
+ fi
+ if test x$enable_aac = xyes; then
+ AC_CHECK_TYPES(mp4AudioSpecificConfig,,,[#include <faad.h>])
+ AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR,faacDecFrameInfo.samplerate],,,[#include <faad.h>])
AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding])
else
AC_MSG_WARN([faad2 lib needed for MP4/AAC support -- disabling MP4/AAC support])