summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-12 01:11:46 -0700
committerChris Robinson <[email protected]>2011-09-12 01:11:46 -0700
commit1d6ecee64f528cbce78dd3b6d8f047decf431938 (patch)
tree7064d8b73cfa52cbf3f9505484273de6b8316d85
parent3ee2826565b76474282879ff741c0f2a70bda4a8 (diff)
Use the active source list when stopping sources on disconnect
-rw-r--r--Alc/ALu.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 716b6fb4..4b4f6778 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1107,22 +1107,22 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
Context = device->ContextList;
while(Context)
{
- ALsource *source;
- ALsizei pos;
+ ALsource **src, **src_end;
- LockUIntMapRead(&Context->SourceMap);
- for(pos = 0;pos < Context->SourceMap.size;pos++)
+ src = Context->ActiveSources;
+ src_end = src + Context->ActiveSourceCount;
+ while(src != src_end)
{
- source = Context->SourceMap.array[pos].value;
- if(source->state == AL_PLAYING)
+ if((*src)->state == AL_PLAYING)
{
- source->state = AL_STOPPED;
- source->BuffersPlayed = source->BuffersInQueue;
- source->position = 0;
- source->position_fraction = 0;
+ (*src)->state = AL_STOPPED;
+ (*src)->BuffersPlayed = (*src)->BuffersInQueue;
+ (*src)->position = 0;
+ (*src)->position_fraction = 0;
}
+ src++;
}
- UnlockUIntMapRead(&Context->SourceMap);
+ Context->ActiveSourceCount = 0;
Context = Context->next;
}