aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index c829d8e7..bf683ba3 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1692,22 +1692,24 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
LockUIntMapRead(&context->SourceMap);
V0(device->Backend,lock)();
- for(pos = 0;pos < context->SourceMap.size;pos++)
+ for(pos = 0;pos < context->VoiceCount;pos++)
{
- ALsource *Source = context->SourceMap.values[pos];
- ALenum new_state;
-
- if(Source->OffsetType != AL_NONE && IsPlayingOrPaused(Source))
+ ALvoice *voice = context->Voices[pos];
+ ALsource *source = voice->Source;
+ if(source && source->OffsetType != AL_NONE)
{
- WriteLock(&Source->queue_lock);
- ApplyOffset(Source);
- WriteUnlock(&Source->queue_lock);
+ WriteLock(&source->queue_lock);
+ ApplyOffset(source, voice);
+ WriteUnlock(&source->queue_lock);
}
-
- new_state = Source->new_state;
- Source->new_state = AL_NONE;
+ }
+ for(pos = 0;pos < context->SourceMap.size;pos++)
+ {
+ ALsource *source = context->SourceMap.values[pos];
+ ALenum new_state = source->new_state;
+ source->new_state = AL_NONE;
if(new_state)
- SetSourceState(Source, context, new_state);
+ SetSourceState(source, context, new_state);
}
V0(device->Backend,unlock)();
UnlockUIntMapRead(&context->SourceMap);