#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
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 ) )
msg_Err( p_dec, "VaSetup failed" );
return -1;
}
+#else
+ assert(0);
+#endif
/* */
p_ff_pic->type = FF_BUFFER_TYPE_USER;