From 0d19a209014582f1e77ab3b927dfb1af6c307d66 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 13 Feb 2017 21:18:18 -0800 Subject: Make the source state atomic Since it's modified by the mixer when playback is ended, a plain struct member isn't safe. --- Alc/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Alc/mixer.c') diff --git a/Alc/mixer.c b/Alc/mixer.c index 592d51d4..179c028e 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -711,7 +711,7 @@ void MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei Samp voice->Moving = AL_TRUE; /* Update source info */ - Source->state = State; + ATOMIC_STORE(&Source->state, State, almemory_order_relaxed); ATOMIC_STORE(&Source->current_buffer, BufferListItem, almemory_order_relaxed); ATOMIC_STORE(&Source->position, DataPosInt, almemory_order_relaxed); ATOMIC_STORE(&Source->position_fraction, DataPosFrac, almemory_order_release); -- cgit v1.2.3