From e2cb41dc61c2cebbd231beac5b6797e245ca619f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 23 Mar 2014 17:33:57 -0700 Subject: [PATCH] Remove the last bits of the predictive sample processing --- Alc/mixer.c | 4 +--- Alc/mixer_c.c | 4 ++-- OpenAL32/Include/alMain.h | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Alc/mixer.c b/Alc/mixer.c index 122476e5..311d0abd 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -90,7 +90,6 @@ static void DoFilter(ALfilterState *filter, ALfloat *restrict dst, const ALfloat ALuint i; for(i = 0;i < numsamples;i++) dst[i] = ALfilterState_processSingle(filter, src[i]); - dst[i] = ALfilterState_processSingleC(filter, src[i]); } @@ -133,7 +132,7 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo) ALuint SrcBufferSize, DstBufferSize; /* Figure out how many buffer samples will be needed */ - DataSize64 = SamplesToDo-OutPos+1; + DataSize64 = SamplesToDo-OutPos; DataSize64 *= increment; DataSize64 += DataPosFrac+FRACTIONMASK; DataSize64 >>= FRACTIONBITS; @@ -145,7 +144,6 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo) DataSize64 = SrcBufferSize; DataSize64 -= BufferPadding+BufferPrePadding; DataSize64 <<= FRACTIONBITS; - DataSize64 -= increment; DataSize64 -= DataPosFrac; DstBufferSize = (ALuint)((DataSize64+(increment-1)) / increment); diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index e4eb9071..efbbf9cb 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -19,7 +19,7 @@ void Resample_copy32_C(const ALfloat *data, ALuint UNUSED(frac), ALuint increment, ALfloat *restrict OutBuffer, ALuint BufferSize) { assert(increment==FRACTIONONE); - memcpy(OutBuffer, data, (BufferSize+1)*sizeof(ALfloat)); + memcpy(OutBuffer, data, BufferSize*sizeof(ALfloat)); } #define DECL_TEMPLATE(Sampler) \ @@ -29,7 +29,7 @@ void Resample_##Sampler##_C(const ALfloat *data, ALuint frac, \ ALuint pos = 0; \ ALuint i; \ \ - for(i = 0;i < BufferSize+1;i++) \ + for(i = 0;i < BufferSize;i++) \ { \ OutBuffer[i] = Sampler(data + pos, frac); \ \ diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 7a8aa53c..04514b5e 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -662,9 +662,9 @@ struct ALCdevice_struct ALuint64 ClockBase; ALuint SamplesDone; - /* Temp storage used for mixing. +1 for the predictive sample. */ - ALIGN(16) ALfloat SampleData1[BUFFERSIZE+1]; - ALIGN(16) ALfloat SampleData2[BUFFERSIZE+1]; + /* Temp storage used for mixing. */ + ALIGN(16) ALfloat SampleData1[BUFFERSIZE]; + ALIGN(16) ALfloat SampleData2[BUFFERSIZE]; // Dry path buffer mix ALIGN(16) ALfloat DryBuffer[MaxChannels][BUFFERSIZE]; -- 2.11.4.GIT