diff mbox series

[FFmpeg-devel,18/34] avformat/internal: Allow AVFormatInternal.pkt to be used by muxers

Message ID AM7PR03MB6660F88FCA0BF1D08011D3098FD29@AM7PR03MB6660.eurprd03.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,01/11] avformat/mux: Sanitize packets without data and side-data
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 6, 2021, 2:27 a.m. UTC
It is unused by the generic muxing code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/internal.h | 4 +++-
 libavformat/mux.c      | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/internal.h b/libavformat/internal.h
index c3d0ff6b88..c16cb5b17f 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -116,7 +116,9 @@  struct AVFormatInternal {
     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 7373fcd1a8..c5e07aaf1c 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1277,6 +1277,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(s->internal->pkt);
     return ret;
 }