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:
@@ -338,7 +338,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
av_fifo_generic_read(s->pkt_fifo, &op, sizeof(ogg_packet), NULL);
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes, 0)) < 0)
|
||||
return ret;
|
||||
av_fifo_generic_read(s->pkt_fifo, avpkt->data, op.bytes, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user