diff options
author | Chris Robinson <[email protected]> | 2010-09-25 23:49:57 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-09-25 23:49:57 -0700 |
commit | 08fdc5fa98c96035b4c2c1c873bfa15895542ef2 (patch) | |
tree | 20d99d53739fe56e37afd3829d22fc7c7ab61edf | |
parent | 7e362249ff57109dcb8dfb4abbade46edea5746c (diff) |
Avoid updating the source in MixSource
-rw-r--r-- | Alc/mixer.c | 21 |
1 files changed, 11 insertions, 10 deletions
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++; } |