From 5cdf774ea7d8ad8e9a6316401e39647040761a3a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 21 May 2011 17:36:54 -0700 Subject: Use the stored sample and channel count --- Alc/ALu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc') diff --git a/Alc/ALu.c b/Alc/ALu.c index e0546a27..cd0c2177 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -130,8 +130,8 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALbuffer *ALBuffer; if((ALBuffer=BufferListItem->buffer) != NULL) { - ALint maxstep = STACK_DATA_SIZE / FrameSizeFromFmt(ALBuffer->FmtChannels, - ALBuffer->FmtType); + ALint maxstep = STACK_DATA_SIZE / ALSource->NumChannels / + ALSource->SampleSize; maxstep -= ResamplerPadding[ALSource->Resampler] + ResamplerPrePadding[ALSource->Resampler] + 1; maxstep = min(maxstep, INT_MAX>>FRACTIONBITS); @@ -635,8 +635,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALbuffer *ALBuffer; if((ALBuffer=BufferListItem->buffer) != NULL) { - ALint maxstep = STACK_DATA_SIZE / FrameSizeFromFmt(ALBuffer->FmtChannels, - ALBuffer->FmtType); + ALint maxstep = STACK_DATA_SIZE / ALSource->NumChannels / + ALSource->SampleSize; maxstep -= ResamplerPadding[ALSource->Resampler] + ResamplerPrePadding[ALSource->Resampler] + 1; maxstep = min(maxstep, INT_MAX>>FRACTIONBITS); -- cgit v1.2.3