mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00: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:
parent
59216e0525
commit
e36db49b7b
89 changed files with 96 additions and 92 deletions
|
|
@ -1777,7 +1777,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||
goto end;
|
||||
}
|
||||
|
||||
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
|
||||
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
|
||||
{
|
||||
if (avpkt->size < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid negative user packet size %d\n", avpkt->size);
|
||||
|
|
@ -1835,7 +1835,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||
|
||||
int ff_alloc_packet(AVPacket *avpkt, int size)
|
||||
{
|
||||
return ff_alloc_packet2(NULL, avpkt, size);
|
||||
return ff_alloc_packet2(NULL, avpkt, size, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue