]> git.sesse.net Git - ffmpeg/commitdiff
lavc/internal: Constify AVPacket* in AVCodecInternal.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 26 Feb 2017 11:34:41 +0000 (12:34 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 16 Mar 2017 20:14:34 +0000 (21:14 +0100)
Fixes a gcc warning:
libavcodec/utils.c:2244:26: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

libavcodec/internal.h
libavcodec/utils.c

index d6e620a9832d2b71fe46520b37da17f0b37245a2..6e93eeb1a91f93d1460208eece91360235dee819 100644 (file)
@@ -141,7 +141,7 @@ typedef struct AVCodecInternal {
      * Current packet as passed into the decoder, to avoid having to pass the
      * packet into every function.
      */
-    AVPacket *pkt;
+    const AVPacket *pkt;
 
     /**
      * temporary buffer used for encoders to store their bitstream
index 4d1b63222f30a0e1bd951ff5bcdd8d930cd2caed..d41ea572f5e3548e7c302798b35579be48e46bab 100644 (file)
@@ -745,7 +745,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
     }
 }
 
-static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame)
+static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame)
 {
     int size;
     const uint8_t *side_metadata;
@@ -759,7 +759,7 @@ static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame)
 
 int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
 {
-    AVPacket *pkt = avctx->internal->pkt;
+    const AVPacket *pkt = avctx->internal->pkt;
     int i;
     static const struct {
         enum AVPacketSideDataType packet;