diff mbox series

[FFmpeg-devel,13/34] avformat/mux: Use AVFormatInternal.parse_pkt for temporary packets

Message ID AM7PR03MB6660E571077D362221686EF08FD29@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
The documentation of said packet ("Every user has to ensure that
this packet is blank after using it") perfectly fits how we use said
packet in the generic muxing code. Better than the documentation of pkt.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/mux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mux.c b/libavformat/mux.c
index ea298c1221..7373fcd1a8 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1174,7 +1174,7 @@  static int write_packets_common(AVFormatContext *s, AVPacket *pkt, int interleav
 
 int av_write_frame(AVFormatContext *s, AVPacket *in)
 {
-    AVPacket *pkt = s->internal->pkt;
+    AVPacket *pkt = s->internal->parse_pkt;
     int ret;
 
     if (!in) {
@@ -1237,8 +1237,8 @@  int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
 
 int av_write_trailer(AVFormatContext *s)
 {
+    AVPacket *const pkt = s->internal->parse_pkt;
     int i, ret1, ret = 0;
-    AVPacket *pkt = s->internal->pkt;
 
     av_packet_unref(pkt);
     for (i = 0; i < s->nb_streams; i++) {
@@ -1328,7 +1328,7 @@  static void uncoded_frame_free(void *unused, uint8_t *data)
 static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index,
                                         AVFrame *frame, int interleaved)
 {
-    AVPacket *pkt = s->internal->pkt;
+    AVPacket *pkt = s->internal->parse_pkt;
 
     av_assert0(s->oformat);
     if (!s->oformat->write_uncoded_frame) {