mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-25 09:51:06 +08:00
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:
@@ -56,7 +56,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
return AVERROR_EXPERIMENTAL;
|
||||
}
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, 32*avctx->height*avctx->width/4)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, 32*avctx->height*avctx->width/4, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
init_put_bits(&pb, pkt->data, pkt->size);
|
||||
|
||||
Reference in New Issue
Block a user