mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
lavc/vaapi_encode: add FF_CODEC_CAP_INIT_CLEANUP caps for encoders
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(). Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
This commit is contained in:
parent
5767a2ed74
commit
2b32068916
7 changed files with 6 additions and 1 deletions
|
|
@ -702,6 +702,7 @@ AVCodec ff_mpeg2_vaapi_encoder = {
|
|||
.close = &vaapi_encode_mpeg2_close,
|
||||
.priv_class = &vaapi_encode_mpeg2_class,
|
||||
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||
.defaults = vaapi_encode_mpeg2_defaults,
|
||||
.pix_fmts = (const enum AVPixelFormat[]) {
|
||||
AV_PIX_FMT_VAAPI,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue