Add av_shrink_packet function for use in av_get_packet that reduces pkt->size

and ensures the following padding is correctly initialized to 0.

Originally committed as revision 18378 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger
2009-04-08 20:19:12 +00:00
parent c81604f862
commit feb993e579
3 changed files with 16 additions and 1 deletions

View File

@@ -2654,6 +2654,14 @@ void av_init_packet(AVPacket *pkt);
*/
int av_new_packet(AVPacket *pkt, int size);
/**
* Reduce packet size, correctly zeroing padding
*
* @param pkt packet
* @param size new size
*/
void av_shrink_packet(AVPacket *pkt, int size);
/**
* @warning This is a hack - the packet memory allocation stuff is broken. The
* packet is allocated if it was not really allocated.