From 1311e051d9497e115a7b2d820945af84ab149903 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 24 Nov 2010 14:54:46 -0800 Subject: Set mixer sample pos and frac when needed --- Alc/mixer.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Alc/mixer.c b/Alc/mixer.c index 35848a19..7f64bad9 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -75,8 +75,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) #define DO_MIX_MONO(data,sampler) do { \ ALfloat (*DryBuffer)[OUTPUTCHANNELS]; \ ALfloat *ClickRemoval, *PendingClicks; \ - ALuint pos = DataPosInt; \ - ALuint frac = DataPosFrac; \ + ALuint pos, frac; \ ALfloat DrySend[OUTPUTCHANNELS]; \ FILTER *DryFilter; \ ALuint BufferIdx; \ @@ -90,6 +89,9 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) for(i = 0;i < OUTPUTCHANNELS;i++) \ DrySend[i] = Source->Params.DryGains[i]; \ \ + pos = DataPosInt; \ + frac = DataPosFrac; \ + \ if(j == 0) \ { \ value = sampler(data[pos], data[pos+1], frac); \ @@ -221,8 +223,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) const ALfloat scaler = 1.0f/Channels; \ ALfloat (*DryBuffer)[OUTPUTCHANNELS]; \ ALfloat *ClickRemoval, *PendingClicks; \ - ALuint pos = DataPosInt; \ - ALuint frac = DataPosFrac; \ + ALuint pos, frac; \ ALfloat DrySend[OUTPUTCHANNELS]; \ FILTER *DryFilter; \ ALuint BufferIdx; \ @@ -236,6 +237,9 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) for(i = 0;i < OUTPUTCHANNELS;i++) \ DrySend[i] = Source->Params.DryGains[i]; \ \ + pos = DataPosInt; \ + frac = DataPosFrac; \ + \ if(j == 0) \ { \ for(i = 0;i < Channels;i++) \ @@ -372,8 +376,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) const ALfloat scaler = 1.0f/Channels; \ ALfloat (*DryBuffer)[OUTPUTCHANNELS]; \ ALfloat *ClickRemoval, *PendingClicks; \ - ALuint pos = DataPosInt; \ - ALuint frac = DataPosFrac; \ + ALuint pos, frac; \ ALfloat DrySend[OUTPUTCHANNELS]; \ FILTER *DryFilter; \ ALuint BufferIdx; \ @@ -387,6 +390,9 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) for(i = 0;i < OUTPUTCHANNELS;i++) \ DrySend[i] = Source->Params.DryGains[i]; \ \ + pos = DataPosInt; \ + frac = DataPosFrac; \ + \ if(j == 0) \ { \ for(i = 0;i < Channels;i++) \ -- cgit v1.2.3