mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-17 12:27:18 +00:00
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:
parent
9442b0de1b
commit
e12a2a2d73
@ -54,7 +54,7 @@ AVPacket *av_packet_alloc(void)
|
||||
if (!pkt)
|
||||
return pkt;
|
||||
|
||||
av_packet_unref(pkt);
|
||||
av_init_packet(pkt);
|
||||
|
||||
return pkt;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user