aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-13 21:18:18 -0800
committerChris Robinson <[email protected]>2017-02-13 21:18:18 -0800
commit0d19a209014582f1e77ab3b927dfb1af6c307d66 (patch)
tree38d5b06d2003a23175522411bfeeffb8fc252f7a /Alc/ALc.c
parent0324712540f88d18f1fa8f18f7a72da06af00d75 (diff)
Make the source state atomic
Since it's modified by the mixer when playback is ended, a plain struct member isn't safe.
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index fcc6d649..69e37540 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1697,8 +1697,7 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
ALsource *Source = context->SourceMap.values[pos];
ALenum new_state;
- if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) &&
- Source->OffsetType != AL_NONE)
+ if(Source->OffsetType != AL_NONE && IsPlayingOrPaused(Source))
{
WriteLock(&Source->queue_lock);
ApplyOffset(Source);