mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-11-01 21:12:53 +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:
@@ -379,7 +379,7 @@ static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
pkt_size = p_frame_output->size;
|
||||
if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0)
|
||||
pkt_size += p_schro_params->enc_buf_size;
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size, 0)) < 0)
|
||||
goto error;
|
||||
|
||||
memcpy(pkt->data, p_frame_output->p_encbuf, p_frame_output->size);
|
||||
|
||||
Reference in New Issue
Block a user