From 08fdc5fa98c96035b4c2c1c873bfa15895542ef2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 25 Sep 2010 23:49:57 -0700 Subject: Avoid updating the source in MixSource --- Alc/mixer.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Alc/mixer.c') diff --git a/Alc/mixer.c b/Alc/mixer.c index a5c3d3c1..0b25c4d4 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -601,9 +601,9 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) } while(0) -static void MixSource(ALsource *Source, ALCcontext *Context, - ALfloat (*DryBuffer)[OUTPUTCHANNELS], ALuint SamplesToDo, - ALfloat *ClickRemoval, ALfloat *PendingClicks) +static ALvoid MixSource(ALsource *Source, ALfloat (*DryBuffer)[OUTPUTCHANNELS], + ALuint SamplesToDo, ALfloat *ClickRemoval, + ALfloat *PendingClicks) { ALbufferlistitem *BufferListItem; ALint64 DataSize64,DataPos64; @@ -614,12 +614,6 @@ static void MixSource(ALsource *Source, ALCcontext *Context, ALenum State; ALuint i, j; - if(Source->NeedsUpdate) - { - ALsource_Update(Source, Context); - Source->NeedsUpdate = AL_FALSE; - } - /* Get source info */ State = Source->state; BuffersPlayed = Source->BuffersPlayed; @@ -808,7 +802,14 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) *src = *(--src_end); continue; } - MixSource(*src, *ctx, DryBuffer, SamplesToDo, + + if((*src)->NeedsUpdate) + { + ALsource_Update(*src, *ctx); + (*src)->NeedsUpdate = AL_FALSE; + } + + MixSource(*src, DryBuffer, SamplesToDo, device->ClickRemoval, device->PendingClicks); src++; } -- cgit v1.2.3