static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );
static void ffmpeg_NextPts( decoder_t * );
+#ifdef HAVE_AVCODEC_VAAPI
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
const enum PixelFormat * );
-
+#endif
static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
{
p_sys->p_context->release_buffer = ffmpeg_ReleaseFrameBuf;
p_sys->p_context->opaque = p_dec;
+#ifdef HAVE_AVCODEC_VAAPI
if( var_CreateGetBool( p_dec, "ffmpeg-hw" ) )
p_sys->p_context->get_format = ffmpeg_GetFormat;
+#endif
/* ***** misc init ***** */
p_sys->input_pts = p_sys->input_dts = 0;
p_sys->p_buffer_orig = p_sys->p_buffer = malloc( p_sys->i_buffer_orig );
if( !p_sys->p_buffer_orig )
{
+ av_free( p_sys->p_ff_pic );
free( p_sys );
return VLC_ENOMEM;
}
if( ffmpeg_OpenCodec( p_dec ) < 0 )
{
msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
+ av_free( p_sys->p_ff_pic );
free( p_sys->p_buffer_orig );
free( p_sys );
return VLC_EGENERIC;
}
}
+#ifdef HAVE_AVCODEC_VAAPI
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec,
const enum PixelFormat *pi_fmt )
{
/* Fallback to default behaviour */
return avcodec_default_get_format( p_codec, pi_fmt );
}
+#endif