aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-22 17:13:03 -0700
committerChris Robinson <[email protected]>2011-08-22 17:13:03 -0700
commit65d42083e1d88e3ef024325f08e6266a87dc03d7 (patch)
tree76358068ad3334a73057144ff592e4ac2356314f /Alc/ALu.c
parent6992a67dd9a496e1440517b1d49a03f3d5a46f45 (diff)
Prevent source and effect slot updates from occuring while updates are deferred
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 18b420fc..9aa431ff 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -979,10 +979,14 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ctx_end = ctx + device->NumContexts;
while(ctx != ctx_end)
{
- ALboolean UpdateSources;
+ ALboolean DeferUpdates = (*ctx)->DeferUpdates;
+ ALboolean UpdateSources = AL_FALSE;
- UpdateSources = (*ctx)->UpdateSources;
- (*ctx)->UpdateSources = AL_FALSE;
+ if(!DeferUpdates)
+ {
+ UpdateSources = (*ctx)->UpdateSources;
+ (*ctx)->UpdateSources = AL_FALSE;
+ }
src = (*ctx)->ActiveSources;
src_end = src + (*ctx)->ActiveSourceCount;
@@ -995,7 +999,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
continue;
}
- if((*src)->NeedsUpdate || UpdateSources)
+ if(!DeferUpdates && ((*src)->NeedsUpdate || UpdateSources))
{
(*src)->NeedsUpdate = AL_FALSE;
ALsource_Update(*src, *ctx);
@@ -1021,7 +1025,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ALEffectSlot->PendingClicks[i] = 0.0f;
}
- if(ALEffectSlot->NeedsUpdate)
+ if(!DeferUpdates && ALEffectSlot->NeedsUpdate)
{
ALEffectSlot->NeedsUpdate = AL_FALSE;
ALEffect_Update(ALEffectSlot->EffectState, *ctx, ALEffectSlot);