diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | src/libfaad/Makefile.am | 19 | ||||
-rw-r--r-- | src/libfaad/xine_faad_decoder.c | 4 |
4 files changed, 40 insertions, 5 deletions
@@ -4,7 +4,7 @@ xine-lib (1.1.15) 2008-??-?? (CVE-2008-3231) This includes a libfaad update from the 1.2 branch. - Delay V4L video frame preallocation until we know how large they'll be. - * Use external ffmpeg by default. + * Use external ffmpeg and libfaad by default. * V4L: Don't segfault if asked for an input that doesn't exist. * Recognise AMR audio (normally found in 3GP files). * Recognise Snow video. diff --git a/configure.ac b/configure.ac index aa8b94904..c96191303 100644 --- a/configure.ac +++ b/configure.ac @@ -1959,7 +1959,27 @@ dnl FAAD build can be optional dnl --------------------------------------------- AC_ARG_ENABLE([faad], AS_HELP_STRING([--disable-faad], [do not build FAAD decoder])) +AC_ARG_WITH(external-libfaad, AS_HELP_STRING([--with-external-libfaad], [use external libfaad (recommended)]), + [external_libfaad="$withval"], [external_libfaad="yes"]) + +have_faad=no +if test "x$enable_faad" = "xno"; then + AC_MSG_RESULT([faad support disabled]) +elif test "x$with_external_libfaad" != "xno"; then + AC_CHECK_LIB([faad], [NeAACDecInit], [have_faad=yes]) + if test "x$have_faad" = xyes; then + AC_CHECK_HEADERS([faad.h], , [have_faad=no]) + if test "x$have_faad" != "xyes"; then + AC_MSG_ERROR([Unable to find libfaad]) + fi + AC_DEFINE([EXTERNAL_LIBFAAD], [1], [Define if external libfaad is used]) + fi +else + AC_MSG_RESULT([Use included libfaad]) +fi + AM_CONDITIONAL(BUILD_FAAD, test "x$enable_faad" != "xno") +AM_CONDITIONAL(EXTERNAL_LIBFAAD, test "x$have_faad" = "xyes") dnl --------------------------------------------- dnl Optional and external libdts diff --git a/src/libfaad/Makefile.am b/src/libfaad/Makefile.am index 92c1fe585..f36fb608a 100644 --- a/src/libfaad/Makefile.am +++ b/src/libfaad/Makefile.am @@ -10,8 +10,10 @@ xineplug_LTLIBRARIES = $(faad_module) VPATH = @srcdir@:@srcdir@/codebook: -xineplug_decode_faad_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -fno-strict-aliasing -xineplug_decode_faad_la_SOURCES = \ +if EXTERNAL_LIBFAAD +libfaad_sources = +else +libfaad_sources = \ bits.c \ cfft.c \ common.c \ @@ -49,11 +51,21 @@ xineplug_decode_faad_la_SOURCES = \ ssr_fb.c \ ssr_ipqf.c \ syntax.c \ - tns.c \ + tns.c +endif + +xineplug_decode_faad_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -fno-strict-aliasing +xineplug_decode_faad_la_SOURCES = \ + $(libfaad_sources) \ xine_faad_decoder.c xineplug_decode_faad_la_LDFLAGS = $(xineplug_ldflags) +if EXTERNAL_LIBFAAD +xineplug_decode_faad_la_LIBADD = $(XINE_LIB) -lfaad -lm $(LTLIBINTL) +else xineplug_decode_faad_la_LIBADD = $(XINE_LIB) -lm $(LTLIBINTL) +endif + noinst_HEADERS = \ analysis.h \ @@ -104,7 +116,6 @@ noinst_HEADERS = \ structs.h \ syntax.h \ tns.h \ - neaacdec.h \ codebook/hcb.h \ codebook/hcb_1.h \ codebook/hcb_2.h \ diff --git a/src/libfaad/xine_faad_decoder.c b/src/libfaad/xine_faad_decoder.c index 6f86d95fd..ae71af155 100644 --- a/src/libfaad/xine_faad_decoder.c +++ b/src/libfaad/xine_faad_decoder.c @@ -35,10 +35,14 @@ #include "audio_out.h" #include "buffer.h" #include "xineutils.h" +#ifdef HAVE_FAAD_H +#include <faad.h> +#else #include "common.h" #include "structs.h" #include "decoder.h" #include "syntax.h" +#endif #define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */ |