aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 1274b824..6eeb3bd8 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1124,6 +1124,7 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
ALuint attrIdx, reqStereoSources;
ALCcontext *ALContext;
void *temp;
+ ALuint i;
SuspendContext(NULL);
@@ -1199,6 +1200,42 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
return NULL;
}
+ for(i = 0;i < device->NumContexts;i++)
+ {
+ ALeffectslot *slot;
+ ALsource *source;
+ for(slot = device->Contexts[i]->AuxiliaryEffectSlot;slot != NULL;
+ slot = slot->next)
+ {
+ if(!slot->EffectState)
+ continue;
+
+ if(ALEffect_DeviceUpdate(slot->EffectState, device) == AL_FALSE)
+ {
+ alcSetError(ALC_INVALID_DEVICE);
+ aluHandleDisconnect(device);
+ ProcessContext(NULL);
+ ALCdevice_StopPlayback(device);
+ return NULL;
+ }
+ ALEffect_Update(slot->EffectState, device->Contexts[i], &slot->effect);
+ }
+
+ for(source = device->Contexts[i]->Source;source != NULL;source = source->next)
+ {
+ ALuint s = device->NumAuxSends;
+ while(s < MAX_SENDS)
+ {
+ if(source->Send[s].Slot)
+ source->Send[s].Slot->refcount--;
+ source->Send[s].Slot = NULL;
+ source->Send[s].WetFilter.type = 0;
+ source->Send[s].WetFilter.filter = 0;
+ s++;
+ }
+ }
+ }
+
if(device->Bs2bLevel > 0 && device->Bs2bLevel <= 6)
{
if(!device->Bs2b)