summaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-02-01 16:23:19 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-02-01 16:33:27 -0500
commit1a670973a756e6e1a7a170d58f3589fd5ad4c088 (patch)
tree493eae88bfb2f2c4e72eea37345d4f79bb2171b1 /libavcodec/utils.c
parent5ff88020ac4cd285fa00d0c559aa196bbd8526d7 (diff)
downloadffmpeg-streaming-1a670973a756e6e1a7a170d58f3589fd5ad4c088.zip
ffmpeg-streaming-1a670973a756e6e1a7a170d58f3589fd5ad4c088.tar.gz
ff_alloc_packet: modify the size of the packet to match the requested size
This will simplify encoders which use this function to request the exact packet size rather than the maximum size.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 34eff00..606537b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -839,16 +839,14 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
if (avpkt->data) {
uint8_t *pkt_data;
- int pkt_size;
if (avpkt->size < size)
return AVERROR(EINVAL);
pkt_data = avpkt->data;
- pkt_size = avpkt->size;
av_init_packet(avpkt);
avpkt->data = pkt_data;
- avpkt->size = pkt_size;
+ avpkt->size = size;
return 0;
} else {
return av_new_packet(avpkt, size);
OpenPOWER on IntegriCloud