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
This commit is contained in:
Reimar Döffinger
2010-11-21 10:24:48 +00:00
parent a08d918e68
commit 6bfc268305
2 changed files with 31 additions and 1 deletions

View File

@@ -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)
{