Re: [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away

2023-09-07 Thread Paul B Mahol
LGTM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away

2023-09-06 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 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, , NULL, s->thread_count);
 } else {
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".