diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-06-20 13:02:59 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-07-07 12:07:23 +0200 |
commit | f2fb882b3f0046493e40306724a6d855b12e2121 (patch) | |
tree | 34164243afceeeccb04aec3df950cb975a979322 /libavcodec/avcodec.c | |
parent | 21de4db402cc40734b30685f9435538e7d35ef9a (diff) | |
download | ffmpeg-f2fb882b3f0046493e40306724a6d855b12e2121.tar.gz |
lavc: add generic-decode-layer private data
Move AVCodecInternal.nb_draining_errors to it, should should not be
visible outside of decode.c.
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r-- | libavcodec/avcodec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index c01dac2049..aef2edce32 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -150,7 +150,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE) return AVERROR(EINVAL); - avci = av_mallocz(sizeof(*avci)); + avci = av_codec_is_decoder(codec) ? + ff_decode_internal_alloc() : + av_mallocz(sizeof(AVCodecInternal)); if (!avci) { ret = AVERROR(ENOMEM); goto end; |