mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/magicyuv: 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>
This commit is contained in:
parent
0eae123dbd
commit
0980d3801d
|
@ -115,7 +115,7 @@ static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1,
|
||||||
static int magy_decode_slice10(AVCodecContext *avctx, void *tdata,
|
static int magy_decode_slice10(AVCodecContext *avctx, void *tdata,
|
||||||
int j, int threadnr)
|
int j, int threadnr)
|
||||||
{
|
{
|
||||||
MagicYUVContext *s = avctx->priv_data;
|
const MagicYUVContext *s = avctx->priv_data;
|
||||||
int interlaced = s->interlaced;
|
int interlaced = s->interlaced;
|
||||||
const int bps = s->bps;
|
const int bps = s->bps;
|
||||||
const int max = s->max - 1;
|
const int max = s->max - 1;
|
||||||
|
@ -247,7 +247,7 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata,
|
||||||
static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
|
static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
|
||||||
int j, int threadnr)
|
int j, int threadnr)
|
||||||
{
|
{
|
||||||
MagicYUVContext *s = avctx->priv_data;
|
const MagicYUVContext *s = avctx->priv_data;
|
||||||
int interlaced = s->interlaced;
|
int interlaced = s->interlaced;
|
||||||
AVFrame *p = s->p;
|
AVFrame *p = s->p;
|
||||||
int i, k, x, min_width;
|
int i, k, x, min_width;
|
||||||
|
|
Loading…
Reference in New Issue