summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-18 05:26:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-18 22:53:00 +0200
commite12a2a2d73436e1514293367ec662562df1780e3 (patch)
tree294f903f6dee44961f6ab5791f67899c0c2e9a71 /libavcodec/avpacket.c
parent9442b0de1bf607ef9577623780897c0380736dd7 (diff)
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/avpacket.c')
-rw-r--r--libavcodec/avpacket.c2
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;
}