From 9c4e97a61b59105c9b539faca272305bbb234c17 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 16 Nov 2008 20:04:49 +0100 Subject: aac: detect whether to pass "uint32_t*" to NeAACDecInit2() neaacdec.h declares all arguments as "unsigned long", but internally expects uint32_t pointers. This triggers gcc warnings on 64 bit architectures. To avoid that, make configure.ac detect whether we're using Debian's corrected headers or the original libfaad headers. In any case, pass a pointer to an uint32_t, conditionally casted to "unsigned long*". --- configure.ac | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 007658ab8..944c1c153 100644 --- a/configure.ac +++ b/configure.ac @@ -622,6 +622,37 @@ fi AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes) +if test x$enable_aac = xyes; then + oldcflags=$CFLAGS + oldlibs=$LIBS + oldcppflags=$CPPFLAGS + CFLAGS="$CFLAGS $MPD_CFLAGS $FAAD_CFLAGS -Werror" + LIBS="$LIBS $MPD_LIBS $FAAD_LIBS" + CPPFLAGS=$CFLAGS + + AC_MSG_CHECKING(for broken libfaad headers) + AC_COMPILE_IFELSE([ +#include +#include +#include + +int main() { + unsigned char channels; + uint32_t sample_rate; + + faacDecInit2(NULL, NULL, 0, &sample_rate, &channels); + return 0; +} + ], + [AC_MSG_RESULT(correct)], + [AC_MSG_RESULT(broken); + AC_DEFINE(HAVE_FAAD_LONG, 1, [Define if faad.h uses the broken "unsigned long" pointers])]) + + CFLAGS=$oldcflags + LIBS=$oldlibs + CPPFLAGS=$oldcppflags +fi + if test x$enable_aac = xyes; then enable_mp4=yes MP4FF_LIBS="-lmp4ff" -- cgit v1.2.3