diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-04-09 10:48:35 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-04-10 12:22:09 +0200 |
commit | 932493f9c2a8cd9c79878694a26a0521114b59a4 (patch) | |
tree | 53788371a7725085b7ee4fdda1d94c05012e87ed /libavcodec/zerocodec.c | |
parent | 05e04e821d2bc977764ca3456e96d8e9850f498c (diff) | |
download | ffmpeg-932493f9c2a8cd9c79878694a26a0521114b59a4.tar.gz |
avcodec/zerocodec: use init cleanup internal cap
Diffstat (limited to 'libavcodec/zerocodec.c')
-rw-r--r-- | libavcodec/zerocodec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index b0fab91004..1051fdaa45 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -131,10 +131,8 @@ static av_cold int zerocodec_decode_init(AVCodecContext *avctx) } zc->previous_frame = av_frame_alloc(); - if (!zc->previous_frame) { - zerocodec_decode_close(avctx); + if (!zc->previous_frame) return AVERROR(ENOMEM); - } return 0; } @@ -157,5 +155,6 @@ AVCodec ff_zerocodec_decoder = { .flush = zerocodec_decode_flush, .close = zerocodec_decode_close, .capabilities = AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, }; |