diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-11-21 10:24:48 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-11-21 10:24:48 +0000 |
commit | 6bfc26830524ca1e5d7fd54e32ea0ffdbcdd25f5 (patch) | |
tree | 89a07b54a151b4b7b7e95056ae5de838afc55923 /libavformat/utils.c | |
parent | a08d918e680266f66f85ddaf232946f7147b74a8 (diff) | |
download | ffmpeg-6bfc26830524ca1e5d7fd54e32ea0ffdbcdd25f5.tar.gz |
Add av_append_packet function, to be used in code that merges packets
to allow palette handling without using PaletteControl.
Originally committed as revision 25777 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 937a615fc0..066da547f3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -339,6 +339,21 @@ int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size) return ret; } +int av_append_packet(ByteIOContext *s, AVPacket *pkt, int size) +{ + int ret; + int old_size; + if (!pkt->size) + return av_get_packet(s, pkt, size); + old_size = pkt->size; + ret = av_grow_packet(pkt, size); + if (ret < 0) + return ret; + ret = get_buffer(s, pkt->data + old_size, size); + av_shrink_packet(pkt, old_size + FFMAX(ret, 0)); + return ret; +} + int av_filename_number_test(const char *filename) { |