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

@ -272,7 +272,7 @@ int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size)
if(ret<=0)
av_free_packet(pkt);
else
pkt->size= ret;
av_shrink_packet(pkt, ret);
return ret;
}