[FFmpeg-devel] [PATCH V1 4/4] lavf/mux: remove unnecessary packet reset

Jun Zhao mypopydev at gmail.com
Tue Sep 10 14:39:28 EEST 2019


From: Jun Zhao <barryjzhao at tencent.com>

remove unnecessary packet reset in av_interleaved_write_frame

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
 libavformat/mux.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 0227c0d..9bac252 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1227,11 +1227,9 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
     for (;; ) {
         AVPacket opkt;
         int ret = interleave_packet(s, &opkt, pkt, flush);
-        if (pkt) {
-            memset(pkt, 0, sizeof(*pkt));
-            av_init_packet(pkt);
+        if (pkt)
             pkt = NULL;
-        }
+
         if (ret <= 0) //FIXME cleanup needed for ret<0 ?
             return ret;
 
-- 
1.7.1



More information about the ffmpeg-devel mailing list