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 <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2015-07-27 19:36:16 +02:00
parent 59216e0525
commit e36db49b7b
89 changed files with 96 additions and 92 deletions

View File

@@ -143,7 +143,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *dst;
/* Alloc buffer */
if ((ret = ff_alloc_packet2(avctx, pkt, utv->buf_size)) < 0)
if ((ret = ff_alloc_packet2(avctx, pkt, utv->buf_size, 0)) < 0)
return ret;
dst = pkt->data;