X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Favcodec%2Fvideo.c;h=eb93e1f4f7128095a945887c698ec2f2cdafd239;hb=5f455214a9bb8efdea1a628989c54cd629c8f21d;hp=0c2fab92a0ced6596c55077561c64fc4b96d3ee9;hpb=fe792c5ebde9900e2f8a0f718f5941fa7f6d9a03;p=vlc diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c index 0c2fab92a0..eb93e1f4f7 100644 --- a/modules/codec/avcodec/video.c +++ b/modules/codec/avcodec/video.c @@ -108,9 +108,10 @@ static int ffmpeg_ReGetFrameBuf( struct AVCodecContext *, AVFrame * ); 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 ) { @@ -331,8 +332,10 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, 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; @@ -346,6 +349,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, 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; } @@ -396,6 +400,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, 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; @@ -1120,6 +1125,7 @@ static void ffmpeg_NextPts( decoder_t *p_dec ) } } +#ifdef HAVE_AVCODEC_VAAPI static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec, const enum PixelFormat *pi_fmt ) { @@ -1168,4 +1174,5 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_codec, /* Fallback to default behaviour */ return avcodec_default_get_format( p_codec, pi_fmt ); } +#endif