[vlc-devel] [PATCH] vdpau: fix build with FFmpeg

Rafaël Carré funman at videolan.org
Tue Mar 4 15:15:50 CET 2014


Tested working with FFmpeg 2.1.4
---
 modules/hw/vdpau/avcodec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index ad8c21b..0e4f258 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -37,6 +37,7 @@
 #include <vlc_xlib.h>
 #include "vlc_vdpau.h"
 #include "../../codec/avcodec/va.h"
+#include "../../codec/avcodec/avcommon_compat.h"
 
 static int Open(vlc_va_t *, int, const es_format_t *);
 static void Close(vlc_va_t *);
@@ -276,7 +277,11 @@ static int Open(vlc_va_t *va, int codec, const es_format_t *fmt)
     if (unlikely(sys == NULL))
        return VLC_ENOMEM;
 
+#if LIBAVCODEC_VERSION_CHECK(55, 26, 0, 42, 100)
     sys->context = av_vdpau_alloc_context();
+#else
+    sys->context = calloc(1, sizeof (*sys->context));
+#endif
     if (unlikely(sys->context == NULL))
     {
         free(sys);
-- 
1.9.0




More information about the vlc-devel mailing list