aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-10-20 11:54:04 -0700
committerChris Robinson <[email protected]>2009-10-20 11:54:04 -0700
commit93361118b7b8c1417e4a717d94818764fb5ffe9e (patch)
treeea3849494057e51400fe88d113114bfb5c9767c9 /Alc/ALu.c
parent50f963f6c67f9c4f2ec6caaad8edc1679e70b8b9 (diff)
Store a device's contexts in a dynamic array
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 49ac2ad8..c7a6d361 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1203,7 +1203,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ALeffectslot *ALEffectSlot;
ALCcontext *ALContext;
int fpuState;
- ALuint i;
+ ALuint i, c;
SuspendContext(NULL);
@@ -1226,9 +1226,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
/* Clear mixing buffer */
memset(DryBuffer, 0, SamplesToDo*OUTPUTCHANNELS*sizeof(ALfloat));
- ALContext = device->Context;
- if(ALContext)
+ for(c = 0;c < device->NumContexts;c++)
{
+ ALContext = device->Contexts[c];
MixSomeSources(ALContext, DryBuffer, SamplesToDo);
/* effect slot processing */
@@ -1378,13 +1378,15 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ALvoid aluHandleDisconnect(ALCdevice *device)
{
- if(device->Context)
+ ALuint i;
+
+ for(i = 0;i < device->NumContexts;i++)
{
ALsource *source;
- SuspendContext(device->Context);
+ SuspendContext(device->Contexts[i]);
- source = device->Context->Source;
+ source = device->Contexts[i]->Source;
while(source)
{
if(source->state == AL_PLAYING)
@@ -1405,7 +1407,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
}
source = source->next;
}
- ProcessContext(device->Context);
+ ProcessContext(device->Contexts[i]);
}
device->Connected = ALC_FALSE;