diff options
author | Chris Robinson <[email protected]> | 2011-08-20 23:59:24 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-08-20 23:59:24 -0700 |
commit | f196a9fc67551aef43f75c3e36f3031170a03dac (patch) | |
tree | b320e7754450bbd7eddc75875b3e9c21e9857377 /OpenAL32/alState.c | |
parent | 7ea71d8bfaa7a05e329ab15ca8828cbc7fe7d00f (diff) |
Defer source state changes from alSourcePlay/Pause/Stop/Rewind calls
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 0e0e5d4b..bb500bf5 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -591,7 +591,23 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) Context = GetLockedContext(); if(!Context) return; - Context->DeferUpdates = AL_FALSE; + if(Context->DeferUpdates) + { + ALsizei pos; + + Context->DeferUpdates = AL_FALSE; + + for(pos = 0;pos < Context->SourceMap.size;pos++) + { + ALsource *src = Context->SourceMap.array[pos].value; + ALenum new_state; + + new_state = src->new_state; + src->new_state = AL_NONE; + if(new_state) + SetSourceState(src, Context, new_state); + } + } UnlockContext(Context); } |