[FFmpeg-devel] [PATCH 79/87] avcodec: Constify AVCodecParserContext.parser

James Almer jamrial at gmail.com
Mon Apr 19 17:10:16 EEST 2021


From: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 doc/APIchanges       | 3 +++
 libavcodec/avcodec.h | 2 +-
 libavcodec/parser.c  | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index f405cd789c..6d47e775a6 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,9 @@ API changes, most recent first:
 2021-04-17 - xxxxxxxxxx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xxxxxxxxxx - lavc yyyyyyyyy - avcodec.h
+  Constified AVCodecParserContext.parser.
+
 2021-04-14 - xxxxxxxxxx - lavd yyyyyyyyy - avdevice.h
   The av_*_device_next API functions now accept and return
   pointers to const AVInputFormat resp. AVOutputFormat.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bb5e8490ca..60d0164903 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2877,7 +2877,7 @@ enum AVPictureStructure {
 
 typedef struct AVCodecParserContext {
     void *priv_data;
-    struct AVCodecParser *parser;
+    const struct AVCodecParser *parser;
     int64_t frame_offset; /* offset of the current frame */
     int64_t cur_offset; /* current offset
                            (incremented by each av_parser_parse()) */
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 593ea9ddf7..f81a62d592 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -55,7 +55,7 @@ found:
     s = av_mallocz(sizeof(AVCodecParserContext));
     if (!s)
         goto err_out;
-    s->parser = (AVCodecParser*)parser;
+    s->parser = parser;
     s->priv_data = av_mallocz(parser->priv_data_size);
     if (!s->priv_data)
         goto err_out;
-- 
2.31.1



More information about the ffmpeg-devel mailing list