From e095047b0253d5503b5e243c8e18279e3c9b3af2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 25 Oct 2009 06:16:21 -0700 Subject: [PATCH] Small fixups --- Alc/ALu.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index e81b151e..d1ff8dec 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -867,6 +867,7 @@ another_source: Bytes = aluBytesFromFormat(ALSource->Format); CalcSourceParams(ALContext, ALSource, (Channels==1)?AL_TRUE:AL_FALSE); + /* Compute 18.14 fixed point step */ Pitch = (ALSource->Params.Pitch*ALSource->Frequency) / frequency; if(Pitch > (float)MAX_PITCH) Pitch = (float)MAX_PITCH; @@ -934,14 +935,6 @@ another_source: if(DataPosInt >= DataSize) goto skipmix; - /* Compute the gain steps for each output channel */ - for(i = 0;i < OUTPUTCHANNELS;i++) - dryGainStep[i] = (ALSource->Params.DryGains[i]- - DrySend[i]) / rampLength; - for(i = 0;i < MAX_SENDS;i++) - wetGainStep[i] = (ALSource->Params.WetGains[i]- - WetSend[i]) / rampLength; - if(BufferListItem->next) { ALbuffer *NextBuf = BufferListItem->next->buffer; @@ -963,6 +956,14 @@ another_source: else memset(&Data[DataSize*Channels], 0, (ALBuffer->padding*Channels*Bytes)); + /* Compute the gain steps for each output channel */ + for(i = 0;i < OUTPUTCHANNELS;i++) + dryGainStep[i] = (ALSource->Params.DryGains[i]- + DrySend[i]) / rampLength; + for(i = 0;i < MAX_SENDS;i++) + wetGainStep[i] = (ALSource->Params.WetGains[i]- + WetSend[i]) / rampLength; + /* Figure out how many samples we can mix. */ DataSize64 = DataSize; DataSize64 <<= FRACTIONBITS; @@ -1128,7 +1129,7 @@ another_source: { BufferListItem = ALSource->queue; BuffersPlayed = 0; - if(ALSource->BuffersInQueue == 1 && DataSize) + if(ALSource->BuffersInQueue == 1) DataPosInt %= DataSize; else DataPosInt -= DataSize; -- 2.11.4.GIT