[vlc-devel] commit: Compilation fix for old ffmpeg version. (Laurent Aimar )

git version control git at videolan.org
Mon Jun 1 19:25:24 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jun  1 19:22:37 2009 +0200| [fe792c5ebde9900e2f8a0f718f5941fa7f6d9a03] | committer: Laurent Aimar 

Compilation fix for old ffmpeg version.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe792c5ebde9900e2f8a0f718f5941fa7f6d9a03
---

 modules/codec/avcodec/vaapi.c |    4 +++-
 modules/codec/avcodec/video.c |    5 +++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 5b2d995..a9d4c6f 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -31,7 +31,9 @@
 
 #ifdef HAVE_LIBAVCODEC_AVCODEC_H
 #   include <libavcodec/avcodec.h>
-#   include <libavcodec/vaapi.h>
+#   ifdef HAVE_AVCODEC_VAAPI
+#       include <libavcodec/vaapi.h>
+#   endif
 #elif defined(HAVE_FFMPEG_AVCODEC_H)
 #   include <ffmpeg/avcodec.h>
 #else
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 879f995..0c2fab9 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -933,6 +933,8 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
 
     if( p_sys->p_va )
     {
+#ifdef HAVE_AVCODEC_VAAPI
+        /* hwaccel_context is not present in old fffmpeg version */
         if( VaSetup( p_sys->p_va,
                      &p_sys->p_context->hwaccel_context, &p_dec->fmt_out.video.i_chroma,
                      p_sys->p_context->width, p_sys->p_context->height ) )
@@ -940,6 +942,9 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
             msg_Err( p_dec, "VaSetup failed" );
             return -1;
         }
+#else
+        assert(0);
+#endif
 
         /* */
         p_ff_pic->type = FF_BUFFER_TYPE_USER;




More information about the vlc-devel mailing list