]> git.sesse.net Git - ffmpeg/commitdiff
avformat/avformat: Constify AVFormatContext.*_codec pointers
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 25 Feb 2021 04:32:20 +0000 (05:32 +0100)
committerJames Almer <jamrial@gmail.com>
Tue, 27 Apr 2021 13:43:13 +0000 (10:43 -0300)
This also allows to exclusively use pointers to const AVCodec in
fftools/ffmpeg_opt.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
doc/APIchanges
fftools/ffmpeg_opt.c
libavformat/avformat.h

index 0434a410f1d54d38b9137908032d14be859b36c0..63434ef6354655419e7727e0500e9f65c7f3b7b7 100644 (file)
@@ -14,6 +14,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
+  Constified AVFormatContext.*_codec.
+
 2021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
   Constified the pointers to AVInputFormats and AVOutputFormats
   in AVFormatContext, avformat_alloc_output_context2(),
index 9e26de5a945c9cc839532f8b476cb41bd80dcd0e..e66141f3ab299da782f4ea8166c5224f6185b2ed 100644 (file)
@@ -737,11 +737,11 @@ static int opt_recording_timestamp(void *optctx, const char *opt, const char *ar
     return 0;
 }
 
-static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
+static const AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
 {
     const AVCodecDescriptor *desc;
     const char *codec_string = encoder ? "encoder" : "decoder";
-    AVCodec *codec;
+    const AVCodec *codec;
 
     codec = encoder ?
         avcodec_find_encoder_by_name(name) :
index 3834c9869ffb594ffbe56785d95dd2a530ad9ca3..23bdaa207bc168eb74b1671c3fd72051175236a7 100644 (file)
@@ -1598,7 +1598,7 @@ typedef struct AVFormatContext {
      * the same codec_id.
      * Demuxing: Set by user
      */
-    AVCodec *video_codec;
+    const AVCodec *video_codec;
 
     /**
      * Forced audio codec.
@@ -1606,7 +1606,7 @@ typedef struct AVFormatContext {
      * the same codec_id.
      * Demuxing: Set by user
      */
-    AVCodec *audio_codec;
+    const AVCodec *audio_codec;
 
     /**
      * Forced subtitle codec.
@@ -1614,7 +1614,7 @@ typedef struct AVFormatContext {
      * the same codec_id.
      * Demuxing: Set by user
      */
-    AVCodec *subtitle_codec;
+    const AVCodec *subtitle_codec;
 
     /**
      * Forced data codec.
@@ -1622,7 +1622,7 @@ typedef struct AVFormatContext {
      * the same codec_id.
      * Demuxing: Set by user
      */
-    AVCodec *data_codec;
+    const AVCodec *data_codec;
 
     /**
      * Number of bytes to be written as padding in a metadata header.