From 590323e3411fb0db4e9f75f132a0b74ebe3eb3e3 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sun, 21 Mar 2004 13:47:45 +0000 Subject: more faad autoconf checks git-svn-id: https://svn.musicpd.org/mpd/trunk@342 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- configure.ac | 6 +++++- src/mp4_decode.c | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 68950ab28..9c91c527a 100644 --- a/configure.ac +++ b/configure.ac @@ -255,9 +255,13 @@ if test x$enable_aac = xyes; then LIBS="$LIBS $MPD_LIBS $FAAD_LIBS" AC_CHECK_HEADER(faad.h,,enable_aac=no) if test x$enable_aac = xyes; then - AC_CHECK_LIB(faad, faacDecDecode,[MPD_LIBS="$MPD_LIBS $FAAD_LIBS";MPD_CFLAGS="$MPD_CFLAGS $FAAD_CFLAGS";MP4FF_SUBDIR="mp4ff";MP4FF_LIB="mp4ff/libmp4ff.la"],enable_aac=no) + AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include ]) 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 ]) 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]) diff --git a/src/mp4_decode.c b/src/mp4_decode.c index cf7fb6137..a2cfc2ee0 100644 --- a/src/mp4_decode.c +++ b/src/mp4_decode.c @@ -132,9 +132,12 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) { config = faacDecGetCurrentConfiguration(decoder); config->outputFormat = FAAD_FMT_16BIT; +#ifdef HAVE_FAACDECCONFIGURATION_DOWNMATRIX config->downMatrix = 1; - /*comment this out, its not in faad2 2.0 rc2*/ - /*config->dontUpSampleImplicitSBR = 0;*/ +#endif +#ifdef HAVE_FAACDECCONFIGURATION_DONTUPSAMPLEIMPLICITSBR + config->dontUpSampleImplicitSBR = 0; +#endif faacDecSetConfiguration(decoder,config); af->bits = 16; -- cgit v1.2.3