diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-09-18 05:26:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-18 22:53:00 +0200 |
commit | e12a2a2d73436e1514293367ec662562df1780e3 (patch) | |
tree | 294f903f6dee44961f6ab5791f67899c0c2e9a71 /libavcodec | |
parent | 9442b0de1bf607ef9577623780897c0380736dd7 (diff) | |
download | ffmpeg-e12a2a2d73436e1514293367ec662562df1780e3.tar.gz |
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avpacket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 2b20067211..858f827a0a 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -54,7 +54,7 @@ AVPacket *av_packet_alloc(void) if (!pkt) return pkt; - av_packet_unref(pkt); + av_init_packet(pkt); return pkt; } |