summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/combined/ffmpeg/ffmpeg_compat.h21
-rw-r--r--src/combined/ffmpeg/ffmpeg_decoder.c1
-rw-r--r--src/combined/ffmpeg/ffmpeg_encoder.c2
3 files changed, 24 insertions, 0 deletions
diff --git a/src/combined/ffmpeg/ffmpeg_compat.h b/src/combined/ffmpeg/ffmpeg_compat.h
index 9a8aaf203..10205c84f 100644
--- a/src/combined/ffmpeg/ffmpeg_compat.h
+++ b/src/combined/ffmpeg/ffmpeg_compat.h
@@ -43,6 +43,27 @@
# undef AVCODEC_HAS_REORDERED_OPAQUE
#endif
+/**/
+#if LIBAVCODEC_VERSION_MAJOR > 53 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 8)
+# define avcodec_init() do {} while(0)
+#endif
+
+/* avcodec_alloc_context() */
+#if LIBAVCODEC_VERSION_MAJOR >= 54 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 6)
+# define AVCONTEXT 3
+# define avcodec_alloc_context() avcodec_alloc_context3(NULL)
+#else
+# define AVCONTEXT 1
+#endif
+
+/* avcodec_open() */
+#if LIBAVCODEC_VERSION_MAJOR >= 54 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 6)
+# define AVOPEN 2
+# define avcodec_open(ctx,codec) avcodec_open2(ctx, codec, NULL)
+#else
+# define AVOPEN 1
+#endif
+
/* avcodec_thread_init() */
#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 112)
# define DEPRECATED_AVCODEC_THREAD_INIT 1
diff --git a/src/combined/ffmpeg/ffmpeg_decoder.c b/src/combined/ffmpeg/ffmpeg_decoder.c
index b50633053..879df5387 100644
--- a/src/combined/ffmpeg/ffmpeg_decoder.c
+++ b/src/combined/ffmpeg/ffmpeg_decoder.c
@@ -28,6 +28,7 @@
#include "xine_internal.h"
#include "ffmpeg_decoder.h"
+#include "ffmpeg_compat.h"
/*
* common initialisation
diff --git a/src/combined/ffmpeg/ffmpeg_encoder.c b/src/combined/ffmpeg/ffmpeg_encoder.c
index d41023675..8e0b03d9b 100644
--- a/src/combined/ffmpeg/ffmpeg_encoder.c
+++ b/src/combined/ffmpeg/ffmpeg_encoder.c
@@ -46,6 +46,8 @@
# include "../../libffmpeg/libavcodec/avcodec.h"
#endif
+#include "ffmpeg_compat.h"
+
/* buffer size for encoded mpeg1 stream; will hold one intra frame
* at 640x480 typical sizes are <50 kB. 512 kB should be plenty */
#define DEFAULT_BUFFER_SIZE 512*1024