aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-23 07:31:33 -0700
committerChris Robinson <[email protected]>2014-03-23 07:31:33 -0700
commit55f851093f08bc1274a4b49c85a0651a9f6e9c0f (patch)
tree12463e35113b48726a202a8146fab578307cfed3 /Alc/ALu.c
parent92433532fef79583f04141db235799a143c5801b (diff)
Remove the now-unneeded click removal buffers for the device
They are still there for auxiliary sends. However, they should go away soon enough too, and then we won't have to mess around with calculating extra "predictive" samples in the mixer.
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c55
1 files changed, 8 insertions, 47 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 9c563023..10e2a45d 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -309,8 +309,6 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext)
DirectChannels = ALSource->DirectChannels;
src->Direct.OutBuffer = Device->DryBuffer;
- src->Direct.ClickRemoval = Device->ClickRemoval;
- src->Direct.PendingClicks = Device->PendingClicks;
for(i = 0;i < NumSends;i++)
{
ALeffectslot *Slot = ALSource->Send[i].Slot;
@@ -659,8 +657,6 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext)
RoomRolloffBase = ALSource->RoomRolloffFactor;
src->Direct.OutBuffer = Device->DryBuffer;
- src->Direct.ClickRemoval = Device->ClickRemoval;
- src->Direct.PendingClicks = Device->PendingClicks;
for(i = 0;i < NumSends;i++)
{
ALeffectslot *Slot = ALSource->Send[i].Slot;
@@ -1254,52 +1250,17 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
device->SamplesDone %= device->Frequency;
ALCdevice_Unlock(device);
- /* Click-removal. Could do better; this only really handles immediate
- * changes between updates where a predictive sample could be
- * generated. Delays caused by effects and HRTF aren't caught. */
- if(device->FmtChans == DevFmtStereo)
+ if(device->Bs2b)
{
- /* Assumes the first two channels are FrontLeft and FrontRight */
- for(c = 0;c < 2;c++)
- {
- ALfloat offset = device->ClickRemoval[c];
- if(offset < (1.0f/32768.0f))
- offset = 0.0f;
- else for(i = 0;i < SamplesToDo;i++)
- {
- device->DryBuffer[c][i] += offset;
- offset -= offset * (1.0f/256.0f);
- }
- device->ClickRemoval[c] = offset + device->PendingClicks[c];
- device->PendingClicks[c] = 0.0f;
- }
- if(device->Bs2b)
+ /* Apply binaural/crossfeed filter */
+ for(i = 0;i < SamplesToDo;i++)
{
float samples[2];
- for(i = 0;i < SamplesToDo;i++)
- {
- samples[0] = device->DryBuffer[FrontLeft][i];
- samples[1] = device->DryBuffer[FrontRight][i];
- bs2b_cross_feed(device->Bs2b, samples);
- device->DryBuffer[FrontLeft][i] = samples[0];
- device->DryBuffer[FrontRight][i] = samples[1];
- }
- }
- }
- else
- {
- for(c = 0;c < MaxChannels;c++)
- {
- ALfloat offset = device->ClickRemoval[c];
- if(offset < (1.0f/32768.0f))
- offset = 0.0f;
- else for(i = 0;i < SamplesToDo;i++)
- {
- device->DryBuffer[c][i] += offset;
- offset -= offset * (1.0f/256.0f);
- }
- device->ClickRemoval[c] = offset + device->PendingClicks[c];
- device->PendingClicks[c] = 0.0f;
+ samples[0] = device->DryBuffer[FrontLeft][i];
+ samples[1] = device->DryBuffer[FrontRight][i];
+ bs2b_cross_feed(device->Bs2b, samples);
+ device->DryBuffer[FrontLeft][i] = samples[0];
+ device->DryBuffer[FrontRight][i] = samples[1];
}
}