diff options
author | Chris Robinson <[email protected]> | 2014-03-18 19:56:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-18 19:56:25 -0700 |
commit | d6f7aac1bbc2c51dbe53e30a50275d550a020df6 (patch) | |
tree | eff721968bc56422bca8e565c3842d1c1422bcc8 /OpenAL32/alState.c | |
parent | 71b177918d2e5864edf45088bf1e5f59d2cd8871 (diff) |
Use a separate struct for tracking active sources
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 280dd896..aebee3e7 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -715,7 +715,7 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) if(!context->DeferUpdates) { ALboolean UpdateSources; - ALsource **src, **src_end; + ALactivesource **src, **src_end; ALeffectslot **slot, **slot_end; FPUCtl oldMode; @@ -731,15 +731,19 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) src_end = src + context->ActiveSourceCount; while(src != src_end) { - if((*src)->state != AL_PLAYING) + ALsource *source = (*src)->Source; + + if(source->state != AL_PLAYING) { - context->ActiveSourceCount--; - *src = *(--src_end); + ALactivesource *temp = *(--src_end); + *src_end = *src; + *src = temp; + --(context->ActiveSourceCount); continue; } - if(ExchangeInt(&(*src)->NeedsUpdate, AL_FALSE) || UpdateSources) - ALsource_Update(*src, context); + if(ExchangeInt(&source->NeedsUpdate, AL_FALSE) || UpdateSources) + ALsource_Update(source, context); src++; } |