mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-23 09:01:00 +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:
@@ -687,7 +687,7 @@ static inline void cx_pktcpy(struct FrameListData *dst,
|
||||
static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
|
||||
AVPacket *pkt)
|
||||
{
|
||||
int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz);
|
||||
int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, 0);
|
||||
uint8_t *side_data;
|
||||
if (ret >= 0) {
|
||||
memcpy(pkt->data, cx_frame->buf, pkt->size);
|
||||
|
Reference in New Issue
Block a user