aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/proresdec2.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-23 06:11:35 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-31 04:22:53 +0200
commit0eae123dbd610b4ad371c6ebfc41a9d5b56abec8 (patch)
tree14992a119b3893a9fe39a5b63c5f46de10312745 /libavcodec/proresdec2.c
parent9c4f7d1e880a000a070f445386c870427e57971c (diff)
downloadffmpeg-0eae123dbd610b4ad371c6ebfc41a9d5b56abec8.tar.gz
avcodec/proresdec2: 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. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/proresdec2.c')
-rw-r--r--libavcodec/proresdec2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 01e650a650..659f9ff16b 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -500,7 +500,7 @@ static const uint8_t lev_to_cb[10] = { 0x04, 0x0A, 0x05, 0x06, 0x04, 0x28, 0x28,
static av_always_inline int decode_ac_coeffs(AVCodecContext *avctx, GetBitContext *gb,
int16_t *out, int blocks_per_slice)
{
- ProresContext *ctx = avctx->priv_data;
+ const ProresContext *ctx = avctx->priv_data;
int block_mask, sign;
unsigned pos, run, level;
int max_coeffs, i, bits_left;
@@ -545,7 +545,7 @@ static int decode_slice_luma(AVCodecContext *avctx, SliceContext *slice,
const uint8_t *buf, unsigned buf_size,
const int16_t *qmat)
{
- ProresContext *ctx = avctx->priv_data;
+ const ProresContext *ctx = avctx->priv_data;
LOCAL_ALIGNED_32(int16_t, blocks, [8*4*64]);
int16_t *block;
GetBitContext gb;
@@ -611,7 +611,7 @@ static int decode_slice_chroma(AVCodecContext *avctx, SliceContext *slice,
/**
* Decode alpha slice plane.
*/
-static void decode_slice_alpha(ProresContext *ctx,
+static void decode_slice_alpha(const ProresContext *ctx,
uint16_t *dst, int dst_stride,
const uint8_t *buf, int buf_size,
int blocks_per_slice)
@@ -643,7 +643,7 @@ static void decode_slice_alpha(ProresContext *ctx,
static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
{
- ProresContext *ctx = avctx->priv_data;
+ const ProresContext *ctx = avctx->priv_data;
SliceContext *slice = &ctx->slices[jobnr];
const uint8_t *buf = slice->data;
AVFrame *pic = ctx->frame;