[FFmpeg-cvslog] avcodec/avpacket: Improve allocating packets

Andreas Rheinhardt git at videolan.org
Thu Sep 19 01:09:35 EEST 2019


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Wed Sep 18 05:26:05 2019 +0200| [e12a2a2d73436e1514293367ec662562df1780e3] | committer: 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: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e12a2a2d73436e1514293367ec662562df1780e3
---

 libavcodec/avpacket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 }



More information about the ffmpeg-cvslog mailing list