History

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().

Linjie Fu committed 6 years ago

Commit 2b320681 parent 5767a2e7 files · +6 −1Browse files

Showing the changes to libavcodec/vaapi_encode.c (1 of 7 files). Show all

Unified · Split

libavcodec/vaapi_encode.c+0−1
@@ -2366,7 +2366,6 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) · 2365 unmodified lines
23662366 return 0;
23672367
23682368 fail:
2369− ff_vaapi_encode_close(avctx);
23702369 return err;
23712370 }
23722371

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t