[FFmpeg-devel] [PATCH] avcodec/xiph: mark returned header pointers const from avpriv_split_xiph_headers()

Michael Niedermayer michaelni at gmx.at
Fri Dec 12 14:46:19 CET 2014


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/vorbis_parser.c |    2 +-
 libavcodec/vorbisdec.c     |    2 +-
 libavcodec/vp3.c           |    2 +-
 libavcodec/xiph.c          |    2 +-
 libavcodec/xiph.h          |    2 +-
 libavformat/matroskaenc.c  |    2 +-
 libavformat/sdp.c          |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/vorbis_parser.c b/libavcodec/vorbis_parser.c
index b99f115..547fd47 100644
--- a/libavcodec/vorbis_parser.c
+++ b/libavcodec/vorbis_parser.c
@@ -184,7 +184,7 @@ bad_header:
 static int vorbis_parse_init(AVVorbisParseContext *s,
                              const uint8_t *extradata, int extradata_size)
 {
-    uint8_t *header_start[3];
+    const uint8_t *header_start[3];
     int header_len[3];
     int ret;
 
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index fb16099..09a863f 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1017,7 +1017,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avctx)
     vorbis_context *vc = avctx->priv_data;
     uint8_t *headers   = avctx->extradata;
     int headers_len    = avctx->extradata_size;
-    uint8_t *header_start[3];
+    const uint8_t *header_start[3];
     int header_len[3];
     GetBitContext *gb = &vc->gb;
     int hdr_type, ret;
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 8aca83a..0e37f0d 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2437,7 +2437,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
     Vp3DecodeContext *s = avctx->priv_data;
     GetBitContext gb;
     int ptype;
-    uint8_t *header_start[3];
+    const uint8_t *header_start[3];
     int header_len[3];
     int i;
 
diff --git a/libavcodec/xiph.c b/libavcodec/xiph.c
index 49b978d..d072224 100644
--- a/libavcodec/xiph.c
+++ b/libavcodec/xiph.c
@@ -22,7 +22,7 @@
 #include "xiph.h"
 
 int avpriv_split_xiph_headers(const uint8_t *extradata, int extradata_size,
-                          int first_header_size, uint8_t *header_start[3],
+                          int first_header_size, const uint8_t *header_start[3],
                           int header_len[3])
 {
     int i;
diff --git a/libavcodec/xiph.h b/libavcodec/xiph.h
index b8ddbbe..1741a51 100644
--- a/libavcodec/xiph.h
+++ b/libavcodec/xiph.h
@@ -37,7 +37,7 @@
  * @return On error a negative value is returned, on success zero.
  */
 int avpriv_split_xiph_headers(const uint8_t *extradata, int extradata_size,
-                              int first_header_size, uint8_t *header_start[3],
+                              int first_header_size, const uint8_t *header_start[3],
                               int header_len[3]);
 
 #endif /* AVCODEC_XIPH_H */
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index e8e8da0..c781c8a 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -491,7 +491,7 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra
 
 static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec)
 {
-    uint8_t *header_start[3];
+    const uint8_t *header_start[3];
     int header_len[3];
     int first_header_size;
     int j;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 5bf9de6..fadabbe 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -348,7 +348,7 @@ static char *extradata2config(AVCodecContext *c)
 static char *xiph_extradata2config(AVCodecContext *c)
 {
     char *config, *encoded_config;
-    uint8_t *header_start[3];
+    const uint8_t *header_start[3];
     int headers_len, header_len[3], config_len;
     int first_header_size;
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list