]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mux: Use const AVPacket * in compare functions
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 13 Aug 2019 02:47:16 +0000 (04:47 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 14 Aug 2019 23:26:21 +0000 (01:26 +0200)
There is no reason for these functions to modify the given packets at
all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/audiointerleave.c
libavformat/audiointerleave.h
libavformat/gxfenc.c
libavformat/internal.h
libavformat/mux.c
libavformat/mxfenc.c

index dea5d99821cd07eca66a6c417d449c928febfdcc..b602eb7105d01213951a53e35c0df7d5a1a28d84 100644 (file)
@@ -108,7 +108,7 @@ static int interleave_new_audio_packet(AVFormatContext *s, AVPacket *pkt,
 
 int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush,
                         int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
-                        int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *))
+                        int (*compare_ts)(AVFormatContext *, const AVPacket *, const AVPacket *))
 {
     int i, ret;
 
index 4d77832fa164ab5fcdfcdd3dc7d3ff6be4485851..f28d5fefcc4d7e5e6ca68899d82f32233fdbba51 100644 (file)
@@ -50,6 +50,6 @@ void ff_audio_interleave_close(AVFormatContext *s);
  */
 int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush,
                         int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
-                        int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *));
+                        int (*compare_ts)(AVFormatContext *, const AVPacket *, const AVPacket *));
 
 #endif /* AVFORMAT_AUDIOINTERLEAVE_H */
index 3507c00b40122510e6701de570a4bdbcfb8b1627..ad9ddea8877b7ccdee493a153093d224d51b9869 100644 (file)
@@ -987,10 +987,11 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-static int gxf_compare_field_nb(AVFormatContext *s, AVPacket *next, AVPacket *cur)
+static int gxf_compare_field_nb(AVFormatContext *s, const AVPacket *next,
+                                                    const AVPacket *cur)
 {
     GXFContext *gxf = s->priv_data;
-    AVPacket *pkt[2] = { cur, next };
+    const AVPacket *pkt[2] = { cur, next };
     int i, field_nb[2];
     GXFStreamContext *sc[2];
 
index cf8c16579cdf254a36f8639f5026052c87a0aa49..d6a039c4976429443d870020c6b6b6857737af47 100644 (file)
@@ -237,7 +237,7 @@ int ff_hex_to_data(uint8_t *data, const char *p);
  * @return 0, or < 0 on error
  */
 int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
-                             int (*compare)(AVFormatContext *, AVPacket *, AVPacket *));
+                             int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *));
 
 void ff_read_frame_flush(AVFormatContext *s);
 
index 8ab5ea8c2bd26aacacd012edfac72bc6b55f9209..c79122160ae9868c6f9f2b4678b957aee59b34b7 100644 (file)
@@ -917,7 +917,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
 #define CHUNK_START 0x1000
 
 int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
-                             int (*compare)(AVFormatContext *, AVPacket *, AVPacket *))
+                             int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *))
 {
     int ret;
     AVPacketList **next_point, *this_pktl;
@@ -994,8 +994,8 @@ next_non_null:
     return 0;
 }
 
-static int interleave_compare_dts(AVFormatContext *s, AVPacket *next,
-                                  AVPacket *pkt)
+static int interleave_compare_dts(AVFormatContext *s, const AVPacket *next,
+                                                      const AVPacket *pkt)
 {
     AVStream *st  = s->streams[pkt->stream_index];
     AVStream *st2 = s->streams[next->stream_index];
index 2e54320cf0e4c0188d73baf7d3c0c3d39652c3cd..8b3d599a6ff98c70c18a30a079213beaa978797e 100644 (file)
@@ -3148,7 +3148,8 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
     }
 }
 
-static int mxf_compare_timestamps(AVFormatContext *s, AVPacket *next, AVPacket *pkt)
+static int mxf_compare_timestamps(AVFormatContext *s, const AVPacket *next,
+                                                      const AVPacket *pkt)
 {
     MXFStreamContext *sc  = s->streams[pkt ->stream_index]->priv_data;
     MXFStreamContext *sc2 = s->streams[next->stream_index]->priv_data;