summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--plugins/ffmpeg/ffmpeg.c19
2 files changed, 22 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1ef1266d..52d9531f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,7 @@ CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\
PKG_CHECK_MODULES(DEPS, samplerate)
PKG_CHECK_MODULES(GTKUI_DEPS, gtk+-2.0 >= 2.12 gthread-2.0 glib-2.0, HAVE_GTK=1, NO_GTK=1)
PKG_CHECK_MODULES(ALSA_DEPS, alsa, HAVE_ALSA=1, NO_ALSA=1)
-PKG_CHECK_MODULES(FFMPEG_DEPS, libavcodec >= 52.0.0 libavutil libavformat >= 52.0.0, HAVE_FFMPEG=1, NO_FFMPEG=1)
+PKG_CHECK_MODULES(FFMPEG_DEPS, libavcodec >= 51.0.0 libavutil libavformat >= 52.0.0, HAVE_FFMPEG=1, NO_FFMPEG=1)
AC_CHECK_LIB([pthread], [main])
AC_CHECK_LIB([dl], [main])
@@ -168,6 +168,8 @@ fi
AM_CONDITIONAL(HAVE_FFMPEG, test $HAVE_FFMPEG)
if test ${HAVE_FFMPEG}; then
+ dnl check headers
+ AC_CHECK_HEADER("ffmpeg/avformat.h", FFMPEG_DEPS_CFLAGS="$FFMPEG_DEPS_CFLAGS -D FFMPEG_OLD")
FFMPEG_DIR="plugins/ffmpeg"
AC_SUBST(FFMPEG_DEPS_CFLAGS)
AC_SUBST(FFMPEG_DEPS_LIBS)
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index d6f10b62..67e3ddd7 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -16,12 +16,31 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <alloca.h>
+#include <errno.h>
+
#include "../../deadbeef.h"
+
+#if !FFMPEG_OLD
+
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libavutil/avstring.h>
+#else
+
+#include <ffmpeg/avformat.h>
+#include <ffmpeg/avcodec.h>
+#include <ffmpeg/avutil.h>
+#include <ffmpeg/avstring.h>
+
+#endif
+
#define trace(...) { fprintf(stderr, __VA_ARGS__); }
//#define trace(fmt,...)