[FFmpeg-cvslog] lavc/internal: Constify AVPacket* in AVCodecInternal.

Carl Eugen Hoyos git at videolan.org
Thu Mar 16 22:16:04 EET 2017


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Feb 26 12:34:41 2017 +0100| [5dd7ea9f569b92c1e3de10eff46b80f3dfa63a1d] | committer: Carl Eugen Hoyos

lavc/internal: Constify AVPacket* in AVCodecInternal.

Fixes a gcc warning:
libavcodec/utils.c:2244:26: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5dd7ea9f569b92c1e3de10eff46b80f3dfa63a1d
---

 libavcodec/internal.h | 2 +-
 libavcodec/utils.c    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index d6e620a..6e93eeb 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -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
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 4d1b632..d41ea57 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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;



More information about the ffmpeg-cvslog mailing list