aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-21 14:47:25 -0700
committerChris Robinson <[email protected]>2014-05-21 14:47:25 -0700
commit4a8d38c19ab12a0ae5ea5efcd81c907d81658eb6 (patch)
tree6524a49a967d9c914dd5b647409c648ce343fe9a /Alc/mixer.c
parentf313ce2a96af4432dd311c2c86343b24f7b555eb (diff)
Update the active source's direct and send properties after each mix
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 6ee76d1f..aa7aea2a 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -356,14 +356,12 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
);
if(!src->IsHrtf)
src->Dry.Mix(parms->OutBuffer, samples, &parms->Mix.Gains[chan],
- maxu(parms->Counter, OutPos) - OutPos, OutPos,
- DstBufferSize);
+ parms->Counter, OutPos, DstBufferSize);
else
src->Dry.HrtfMix(
- parms->OutBuffer, SrcData, maxu(parms->Counter, OutPos) - OutPos,
- parms->Offset + OutPos, OutPos, parms->Mix.Hrtf.IrSize,
- &parms->Mix.Hrtf.Params[chan], &parms->Mix.Hrtf.State[chan],
- DstBufferSize
+ parms->OutBuffer, SrcData, parms->Counter, parms->Offset,
+ OutPos, parms->Mix.Hrtf.IrSize, &parms->Mix.Hrtf.Params[chan],
+ &parms->Mix.Hrtf.State[chan], DstBufferSize
);
}
@@ -381,8 +379,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
parms->Filters[chan].ActiveType
);
src->WetMix(parms->OutBuffer, samples, &parms->Gain,
- maxu(parms->Counter, OutPos) - OutPos,
- OutPos, DstBufferSize);
+ parms->Counter, OutPos, DstBufferSize);
}
}
/* Update positions */
@@ -393,6 +390,10 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
DataPosFrac &= FRACTIONMASK;
}
OutPos += DstBufferSize;
+ src->Direct.Offset += DstBufferSize;
+ src->Direct.Counter = maxu(src->Direct.Counter, DstBufferSize) - DstBufferSize;
+ for(j = 0;j < Device->NumAuxSends;j++)
+ src->Send[j].Counter = maxu(src->Send[j].Counter, DstBufferSize) - DstBufferSize;
/* Handle looping sources */
while(1)
@@ -443,6 +444,4 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
Source->current_buffer = BufferListItem;
Source->position = DataPosInt;
Source->position_fraction = DataPosFrac;
- src->Direct.Offset += OutPos;
- src->Direct.Counter = maxu(src->Direct.Counter, OutPos) - OutPos;
}