[FFmpeg-devel] [PATCH] lavc/vaapi: release buffer before destroy context.
Song, Ruiling
ruiling.song at intel.com
Thu Feb 8 05:17:27 EET 2018
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Jun Zhao
> Sent: Thursday, February 8, 2018 11:08 AM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>;
> Song, Ruiling <ruiling.song at intel.com>
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/vaapi: release buffer before destroy
> context.
>
>
>
> On 2018/2/8 9:35, Ruiling Song wrote:
> > The common way to use libVA was first destroy the buffer, then the
> > context. I am not sure whether libVA has clear statement on this.
> > This patch just make things simple. This would fix an segmentation
> > fault issue against iHD open source driver.
> >
> > Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> > ---
> > libavcodec/vaapi_encode.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
> > index 550ea47..607e3ab 100644
> > --- a/libavcodec/vaapi_encode.c
> > +++ b/libavcodec/vaapi_encode.c
> > @@ -1562,6 +1562,8 @@ av_cold int
> ff_vaapi_encode_close(AVCodecContext *avctx)
> > vaapi_encode_free(avctx, pic);
> > }
> >
> > + av_buffer_pool_uninit(&ctx->output_buffer_pool);
> > +
> > if (ctx->va_context != VA_INVALID_ID) {
> > vaDestroyContext(ctx->hwctx->display, ctx->va_context);
> > ctx->va_context = VA_INVALID_ID;
> > @@ -1572,7 +1574,6 @@ av_cold int
> ff_vaapi_encode_close(AVCodecContext *avctx)
> > ctx->va_config = VA_INVALID_ID;
> > }
> >
> > - av_buffer_pool_uninit(&ctx->output_buffer_pool);
> >
> > av_freep(&ctx->codec_sequence_params);
> > av_freep(&ctx->codec_picture_params);
> I think Mark have submit this patch in Libav:
> https://patches.libav.org/patch/64112/
I am sorry I did not notice that. Please ignore the patch.
I think we can merge Mark's patch now so we can have some try on iHD open source driver.
Ruiling
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list