Commit e12a2a2d authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9442b0de
......@@ -54,7 +54,7 @@ AVPacket *av_packet_alloc(void)
if (!pkt)
return pkt;
av_packet_unref(pkt);
av_init_packet(pkt);
return pkt;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment