> -----Original Message----- > From: ffmpeg-devel [mailto:[email protected]] On Behalf Of > Jun Zhao > Sent: Thursday, February 8, 2018 11:08 AM > To: FFmpeg development discussions and patches <[email protected]>; > Song, Ruiling <[email protected]> > 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 <[email protected]> > > --- > > 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 > [email protected] > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel _______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
