summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-03-23 14:17:57 +0100
committerAnton Khirnov <anton@khirnov.net>2022-04-13 12:14:08 +0200
commit1c01dca14471774b93a418127555d85ceb641333 (patch)
treea5a9037d3ae9b1abe19e6655f86c58fe2d61dd03 /libavcodec/avcodec.c
parent7efa6418b83ae123770c6930f492edb87cd19274 (diff)
lavc/avcodec: only allocate the encoding frame for encoders
And only when needed, i.e. for encoders using the simple API.
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r--libavcodec/avcodec.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index dbaa9f78a2..c7daa385e7 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -180,14 +180,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
avci->buffer_frame = av_frame_alloc();
avci->buffer_pkt = av_packet_alloc();
- avci->es.in_frame = av_frame_alloc();
avci->in_pkt = av_packet_alloc();
avci->last_pkt_props = av_packet_alloc();
avci->pkt_props = av_fifo_alloc2(1, sizeof(*avci->last_pkt_props),
AV_FIFO_FLAG_AUTO_GROW);
if (!avci->buffer_frame || !avci->buffer_pkt ||
- !avci->es.in_frame || !avci->in_pkt ||
- !avci->last_pkt_props || !avci->pkt_props) {
+ !avci->in_pkt || !avci->last_pkt_props || !avci->pkt_props) {
ret = AVERROR(ENOMEM);
goto free_and_end;
}