[FFmpeg-cvslog] avcodec/v210dec: Don't cast const away

Andreas Rheinhardt git at videolan.org
Thu Sep 7 21:57:41 EEST 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Sep  6 23:34:56 2023 +0200| [2f9a33995a7be728d7ab4dce913be5a871c5cc5f] | committer: Andreas Rheinhardt

avcodec/v210dec: Don't cast const away

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/v210dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 814d65bbda..04bcc612b7 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -33,7 +33,7 @@
 
 typedef struct ThreadData {
     AVFrame *frame;
-    uint8_t *buf;
+    const uint8_t *buf;
     int stride;
 } ThreadData;
 
@@ -111,7 +111,7 @@ static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th
     int stride = td->stride;
     int slice_start = (avctx->height *  jobnr) / s->thread_count;
     int slice_end = (avctx->height * (jobnr+1)) / s->thread_count;
-    uint8_t *psrc = td->buf + stride * slice_start;
+    const uint8_t *psrc = td->buf + stride * slice_start;
     int16_t *py = (uint16_t*)frame->data[0] + slice_start * frame->linesize[0] / 2;
     int16_t *pu = (uint16_t*)frame->data[1] + slice_start * frame->linesize[1] / 2;
     int16_t *pv = (uint16_t*)frame->data[2] + slice_start * frame->linesize[2] / 2;
@@ -191,7 +191,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic,
 
     if (stride) {
         td.stride = stride;
-        td.buf = (uint8_t*)psrc;
+        td.buf = psrc;
         td.frame = pic;
         avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count);
     } else {



More information about the ffmpeg-cvslog mailing list