mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-26 02:10:55 +08:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user