avcodec/avpacket: Improve allocating packets

av_mallocz + av_init_packet leads to the same result as av_mallocz +
av_packet_unref, but faster.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Andreas Rheinhardt 2019-09-18 05:26:05 +02:00 committed by Michael Niedermayer
parent 9442b0de1b
commit e12a2a2d73

View File

@ -54,7 +54,7 @@ AVPacket *av_packet_alloc(void)
if (!pkt)
return pkt;
av_packet_unref(pkt);
av_init_packet(pkt);
return pkt;
}