diff options
-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++; } |