[FFmpeg-cvslog] avcodec/vp8: Constify slice threads' ptr to main context

Andreas Rheinhardt git at videolan.org
Sun Jul 31 05:51:06 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Jul 23 04:35:33 2022 +0200| [9c4f7d1e880a000a070f445386c870427e57971c] | committer: Andreas Rheinhardt

avcodec/vp8: Constify slice threads' ptr to main context

Modifying the main context from a slice thread is (usually)
a data race, so it must not happen. So only use a pointer to const
to access the main context.

Reviewed-by: Ronald S. Bultje <rsbultje at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/vp8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 2687aeb1f8..7a151feb79 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2619,7 +2619,7 @@ static av_always_inline
 int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
                               int threadnr, int is_vp7)
 {
-    VP8Context *s = avctx->priv_data;
+    const VP8Context *s = avctx->priv_data;
     VP8ThreadData *td = &s->thread_data[jobnr];
     VP8ThreadData *next_td = NULL, *prev_td = NULL;
     VP8Frame *curframe = s->curframe;



More information about the ffmpeg-cvslog mailing list