From e36db49b7b31cb17912895cb4d95b7b45d6f0882 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 27 Jul 2015 19:36:16 +0200 Subject: avcodec: Add a min size parameter to ff_alloc_packet2() This parameter can be used to inform the allocation code about how much downsizing might occur, and can be used to optimize how to allocate the packet Signed-off-by: Michael Niedermayer --- libavcodec/pngenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/pngenc.c') diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index ad05311aab..6a5e0f8860 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -502,7 +502,7 @@ static int encode_png(AVCodecContext *avctx, AVPacket *pkt, ); if (max_packet_size > INT_MAX) return AVERROR(ENOMEM); - ret = ff_alloc_packet2(avctx, pkt, max_packet_size); + ret = ff_alloc_packet2(avctx, pkt, max_packet_size, 0); if (ret < 0) return ret; @@ -560,7 +560,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt, ); if (max_packet_size > INT_MAX) return AVERROR(ENOMEM); - ret = ff_alloc_packet2(avctx, pkt, max_packet_size); + ret = ff_alloc_packet2(avctx, pkt, max_packet_size, 0); if (ret < 0) return ret; -- cgit v1.2.1