summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-27 19:36:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-27 19:57:52 +0200
commite36db49b7b31cb17912895cb4d95b7b45d6f0882 (patch)
treee8cb205407627584f9d9eb6563a02dac3c4cfbd8 /libavcodec/utils.c
parent59216e0525a58714be4207be6ae8744750e62867 (diff)
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>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d926a2631a..b147559aba 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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);
}
/**