[FFmpeg-devel] [PATCH 17/17] Add missing const to AVInputFormat pointers.

Anton Khirnov anton at khirnov.net
Mon Apr 5 14:09:54 EEST 2021


---
 fftools/ffmpeg_opt.c    | 2 +-
 fftools/ffprobe.c       | 2 +-
 libavdevice/internal.h  | 2 +-
 libavdevice/utils.c     | 2 +-
 libavfilter/lavfutils.c | 2 +-
 libavfilter/src_movie.c | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 807e783422..5a24aa7a03 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1068,7 +1068,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
 {
     InputFile *f;
     AVFormatContext *ic;
-    AVInputFormat *file_iformat = NULL;
+    const AVInputFormat *file_iformat = NULL;
     int err, i, ret;
     int64_t timestamp;
     AVDictionary *unused_opts = NULL;
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index c136562afe..da4f21da79 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -257,7 +257,7 @@ static const OptionDef *options;
 /* FFprobe context */
 static const char *input_filename;
 static const char *print_input_filename;
-static AVInputFormat *iformat = NULL;
+static const AVInputFormat *iformat = NULL;
 
 static struct AVHashContext *hash;
 
diff --git a/libavdevice/internal.h b/libavdevice/internal.h
index e222cf204d..ce060c0f5d 100644
--- a/libavdevice/internal.h
+++ b/libavdevice/internal.h
@@ -22,7 +22,7 @@
 #include "libavformat/avformat.h"
 
 av_warn_unused_result
-int ff_alloc_input_device_context(struct AVFormatContext **avctx, struct AVInputFormat *iformat,
+int ff_alloc_input_device_context(struct AVFormatContext **avctx, const struct AVInputFormat *iformat,
                                   const char *format);
 
 #endif
diff --git a/libavdevice/utils.c b/libavdevice/utils.c
index ccd7318012..d9a52c53ab 100644
--- a/libavdevice/utils.c
+++ b/libavdevice/utils.c
@@ -20,7 +20,7 @@
 #include "libavutil/opt.h"
 #include "libavformat/avformat.h"
 
-int ff_alloc_input_device_context(AVFormatContext **avctx, AVInputFormat *iformat, const char *format)
+int ff_alloc_input_device_context(AVFormatContext **avctx, const AVInputFormat *iformat, const char *format)
 {
     AVFormatContext *s;
     int ret = 0;
diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
index 34051ee61d..2bc06257c6 100644
--- a/libavfilter/lavfutils.c
+++ b/libavfilter/lavfutils.c
@@ -26,7 +26,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
                   int *w, int *h, enum AVPixelFormat *pix_fmt,
                   const char *filename, void *log_ctx)
 {
-    AVInputFormat *iformat = NULL;
+    const AVInputFormat *iformat = NULL;
     AVFormatContext *format_ctx = NULL;
     const AVCodec *codec;
     AVCodecContext *codec_ctx = NULL;
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 5892500410..e449e7e0c2 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -205,7 +205,7 @@ static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx)
 static av_cold int movie_common_init(AVFilterContext *ctx)
 {
     MovieContext *movie = ctx->priv;
-    AVInputFormat *iformat = NULL;
+    const AVInputFormat *iformat = NULL;
     int64_t timestamp;
     int nb_streams = 1, ret, i;
     char default_streams[16], *stream_specs, *spec, *cursor;
-- 
2.30.2



More information about the ffmpeg-devel mailing list