[FFmpeg-devel] [PATCH] lavc/vaapi_encode: add FF_CODEC_CAP_INIT_CLEANUP caps for encoders

Fu, Linjie linjie.fu at intel.com
Mon May 4 18:32:12 EEST 2020


> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Timo Rothenpieler
> Sent: Monday, May 4, 2020 13:20
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/vaapi_encode: add
> FF_CODEC_CAP_INIT_CLEANUP caps for encoders
> 
> On 31.03.2020 17:34, Linjie Fu wrote:
> > ff_vaapi_encode_close() is not enough to free the resources like cbs
> > if initialization failure happens after codec->configure (except for
> > vp8/vp9).
> >
> > We need to call avctx->codec->close() to deallocate, otherwise memory
> > leak happens.
> >
> > Add FF_CODEC_CAP_INIT_CLEANUP for vaapi encoders and deallocate the
> > resources at free_and_end inside avcodec_open2().
> >
> > Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> 
> Not my area of code, but the patch looks straight forward enough to my eyes.

Thanks for review, and hope this could be merged soon.

- Linjie


More information about the ffmpeg-devel mailing list