[FFmpeg-cvslog] avformat/internal: Allow AVFormatInternal.pkt to be used by muxers

Andreas Rheinhardt git at videolan.org
Sun Oct 3 23:48:52 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Sep  5 23:18:29 2021 +0200| [c2bb05497911a0900b745eaa4a7f05d72b3610ef] | committer: Andreas Rheinhardt

avformat/internal: Allow AVFormatInternal.pkt to be used by muxers

It is unused by the generic muxing code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavformat/internal.h | 4 +++-
 libavformat/mux.c      | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 98341ba217..f1ae7db365 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -121,7 +121,9 @@ typedef struct FFFormatContext {
     AVPacket *parse_pkt;
 
     /**
-     * Used to hold temporary packets.
+     * Used to hold temporary packets for the generic demuxing code.
+     * When muxing, it may be used by muxers to hold packets (even
+     * permanent ones).
      */
     AVPacket *pkt;
     /**
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 3d007ec943..be9ba88365 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1292,6 +1292,7 @@ int av_write_trailer(AVFormatContext *s)
     if (s->oformat->priv_class)
         av_opt_free(s->priv_data);
     av_freep(&s->priv_data);
+    av_packet_unref(si->pkt);
     return ret;
 }
 



More information about the ffmpeg-cvslog mailing list