[FFmpeg-cvslog] vaapi_mpeg2: Constify pointers

Mark Thompson git at videolan.org
Sat Mar 18 21:05:42 EET 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sat Aug  6 16:40:14 2016 +0100| [ee9061293e925916fe2e0b7c08fbbd1f981b1d29] | committer: Mark Thompson

vaapi_mpeg2: Constify pointers

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

 libavcodec/vaapi_mpeg2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index cb77745..459eb75 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -26,21 +26,21 @@
 #include "internal.h"
 
 /** Reconstruct bitstream f_code */
-static inline int mpeg2_get_f_code(MpegEncContext *s)
+static inline int mpeg2_get_f_code(const MpegEncContext *s)
 {
     return (s->mpeg_f_code[0][0] << 12) | (s->mpeg_f_code[0][1] << 8) |
            (s->mpeg_f_code[1][0] <<  4) |  s->mpeg_f_code[1][1];
 }
 
 /** Determine frame start: first field for field picture or frame picture */
-static inline int mpeg2_get_is_frame_start(MpegEncContext *s)
+static inline int mpeg2_get_is_frame_start(const MpegEncContext *s)
 {
     return s->first_field || s->picture_structure == PICT_FRAME;
 }
 
 static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
 {
-    struct MpegEncContext * const s = avctx->priv_data;
+    const MpegEncContext *s = avctx->priv_data;
     struct vaapi_context * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferMPEG2 *pic_param;
     VAIQMatrixBufferMPEG2 *iq_matrix;
@@ -101,7 +101,7 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
 
 static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
 {
-    MpegEncContext * const s = avctx->priv_data;
+    const MpegEncContext *s = avctx->priv_data;
     VASliceParameterBufferMPEG2 *slice_param;
     GetBitContext gb;
     uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset;



More information about the ffmpeg-cvslog mailing list