aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-24 14:54:46 -0800
committerChris Robinson <[email protected]>2010-11-24 14:54:46 -0800
commit1311e051d9497e115a7b2d820945af84ab149903 (patch)
treecd6a063c1043799bf6f1453264da6f24a061f4d9
parentc9363832fe7755bec5e5c4ee56c7be3c00c2555e (diff)
Set mixer sample pos and frac when needed
-rw-r--r--Alc/mixer.c18
1 files 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++) \