aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-08-20 21:35:18 -0700
committerChris Robinson <[email protected]>2014-08-21 00:29:42 -0700
commitb92e643e9742765acd364bcbe30ebaedbe50400f (patch)
treee65318fdffb9105d9b247f425e09b283c855552d /Alc/ALc.c
parent3a6baab495d92afd17fccd61b87ae526235fce88 (diff)
Use a NULL source for inactive activesources
Also only access the activesource's source field once per update.
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index e03e3655..53295fa0 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1927,6 +1927,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
ALactivesource *src = context->ActiveSources[pos];
ALsource *source = src->Source;
ALuint s = device->NumAuxSends;
+
while(s < MAX_SENDS)
{
src->Send[s].Moving = AL_FALSE;
@@ -1934,8 +1935,11 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
s++;
}
- src->Update(src, context);
- ATOMIC_STORE(&source->NeedsUpdate, AL_FALSE);
+ if(source)
+ {
+ src->Update(src, source, context);
+ ATOMIC_STORE(&source->NeedsUpdate, AL_FALSE);
+ }
}
context = context->next;