diff options
author | Chris Robinson <[email protected]> | 2009-10-20 13:02:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-10-20 13:02:28 -0700 |
commit | 9f9b7cf88555cd26a8b25ce72e686bb27b45c431 (patch) | |
tree | f42a7bb3b0b2f72b38d15edce6f30da22dfd8aaa /Alc | |
parent | cd695d7f152831fab2d19d78e80ae8e7982eea72 (diff) |
Make sure the context is properly locked while updating slots and sends
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1203,10 +1203,12 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint for(i = 0;i < device->NumContexts;i++) { + ALCcontext *context = device->Contexts[i]; ALeffectslot *slot; ALsource *source; - for(slot = device->Contexts[i]->AuxiliaryEffectSlot;slot != NULL; - slot = slot->next) + + SuspendContext(context); + for(slot = context->AuxiliaryEffectSlot;slot != NULL;slot = slot->next) { if(!slot->EffectState) continue; @@ -1215,14 +1217,15 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint { alcSetError(ALC_INVALID_DEVICE); aluHandleDisconnect(device); + ProcessContext(context); ProcessContext(NULL); ALCdevice_StopPlayback(device); return NULL; } - ALEffect_Update(slot->EffectState, device->Contexts[i], &slot->effect); + ALEffect_Update(slot->EffectState, context, &slot->effect); } - for(source = device->Contexts[i]->Source;source != NULL;source = source->next) + for(source = context->Source;source != NULL;source = source->next) { ALuint s = device->NumAuxSends; while(s < MAX_SENDS) @@ -1235,6 +1238,7 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint s++; } } + ProcessContext(context); } if(device->Bs2bLevel > 0 && device->Bs2bLevel <= 6) |