aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-07-24 00:41:25 -0700
committerChris Robinson <[email protected]>2008-07-24 00:41:25 -0700
commit559c786d0c7ffd1135202469f1841b8d9d97d18c (patch)
tree774442f8affdd6881d28b3d62ebaa78274cf34ec /Alc
parentc3a74809615dbe8bdaa938b9e963e8bb65427a0e (diff)
Specify padding per buffer, and make sure it's large enough for the filter step
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index fe3b9898..43837123 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -680,6 +680,9 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
DataPos64 <<= FRACTIONBITS;
DataPos64 += DataPosFrac;
BufferSize = (ALuint)((DataSize64-DataPos64+(increment-1)) / increment);
+ LowStep = Frequency/LOWPASSFREQCUTOFF;
+ if(LowStep < 1) LowStep = 1;
+
BufferListItem = ALSource->queue;
for(loop = 0; loop < ALSource->BuffersPlayed; loop++)
{
@@ -693,7 +696,7 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
ALbuffer *NextBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(BufferListItem->next->buffer);
if(NextBuf && NextBuf->data)
{
- ulExtraSamples = min(NextBuf->size, (ALint)(16*Channels));
+ ulExtraSamples = min(NextBuf->size, (ALint)(ALBuffer->padding*Channels*2));
memcpy(&Data[DataSize*Channels], NextBuf->data, ulExtraSamples);
}
}
@@ -702,7 +705,7 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
ALbuffer *NextBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(ALSource->queue->buffer);
if (NextBuf && NextBuf->data)
{
- ulExtraSamples = min(NextBuf->size, (ALint)(16*Channels));
+ ulExtraSamples = min(NextBuf->size, (ALint)(ALBuffer->padding*Channels*2));
memcpy(&Data[DataSize*Channels], NextBuf->data, ulExtraSamples);
}
}
@@ -710,9 +713,6 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
BufferSize = min(BufferSize, (SamplesToDo-j));
//Actual sample mixing loop
- LowStep = Frequency/5000;
- if(LowStep < 1) LowStep = 1;
- if(LowStep > 8) LowStep = 8;
Data += DataPosInt*Channels;
while(BufferSize--)
{