aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-21 17:36:54 -0700
committerChris Robinson <[email protected]>2011-05-21 17:36:54 -0700
commit5cdf774ea7d8ad8e9a6316401e39647040761a3a (patch)
tree14a422c9a20576848a83e28f744794b4cefddcc6 /Alc
parentb75d4beb1aa1c27be866301290e40b9500e56f1e (diff)
Use the stored sample and channel count
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c8
1 files changed, 4 insertions, 4 deletions
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);