aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-21 08:34:19 +0200
committerMax Kellermann <max@duempel.org>2008-10-21 08:34:19 +0200
commitdef97411f2a613b26a47a87c55e241a6dcaf3e78 (patch)
treecf37f983ac0632ea31b2f0b11dfea95117c7c946
parentd52437d43f159bc03072bedcf2ac8aa7766be0ea (diff)
downloadmpd-def97411f2a613b26a47a87c55e241a6dcaf3e78.tar.gz
mpd-def97411f2a613b26a47a87c55e241a6dcaf3e78.tar.xz
mpd-def97411f2a613b26a47a87c55e241a6dcaf3e78.zip
ffmpeg: detect which ffmpeg headers should be included
Since ffmpeg svn r12865, you have to include libavcodec/avcodec.h instead of avcodec.h. This cannot be checked at compile time, instead we have to add a check to configure.ac. Viliam's original ffmpeg plugin was based on the newer ffmpeg library, while my Debian installation had the older version. My attempt to correct his include statements wasn't correct after all.
Diffstat (limited to '')
-rw-r--r--configure.ac11
-rw-r--r--src/inputPlugins/ffmpeg_plugin.c6
2 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 2a2552972..3395b6dcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -689,6 +689,17 @@ if test x$enable_ffmpeg = xyes; then
enable_ffmpeg=no)
fi
+if test x$enable_ffmpeg = xyes; then
+ # prior to ffmpeg svn12865, you had to specify include files
+ # without path prefix
+ old_CPPCFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
+ AC_CHECK_HEADER(libavcodec/avcodec.h,,
+ AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
+ [Define if avcodec.h instead of libavcodec/avcodec.h should be included]))
+ CPPCFLAGS=$old_CPPFLAGS
+fi
+
AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes)
case $with_zeroconf in
diff --git a/src/inputPlugins/ffmpeg_plugin.c b/src/inputPlugins/ffmpeg_plugin.c
index 7d3c24360..95e15957c 100644
--- a/src/inputPlugins/ffmpeg_plugin.c
+++ b/src/inputPlugins/ffmpeg_plugin.c
@@ -29,9 +29,15 @@
#include <sys/stat.h>
#include <unistd.h>
+#ifdef OLD_FFMPEG_INCLUDES
#include <avcodec.h>
#include <avformat.h>
#include <avio.h>
+#else
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libavformat/avio.h>
+#endif
typedef struct {
int audioStream;