diff options
author | Chris Robinson <[email protected]> | 2014-08-20 21:35:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-08-21 00:29:42 -0700 |
commit | b92e643e9742765acd364bcbe30ebaedbe50400f (patch) | |
tree | e65318fdffb9105d9b247f425e09b283c855552d /Alc/ALc.c | |
parent | 3a6baab495d92afd17fccd61b87ae526235fce88 (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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; |