diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -1845,31 +1845,32 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples) if(LIKELY(device->PostProcess)) device->PostProcess(device, SamplesToDo); - if(OutBuffer) + if(device->Stablizer) { - ALfloat (*Buffer)[BUFFERSIZE] = device->RealOut.Buffer; - ALsizei Channels = device->RealOut.NumChannels; + int lidx = GetChannelIdxByName(&device->RealOut, FrontLeft); + int ridx = GetChannelIdxByName(&device->RealOut, FrontRight); + int cidx = GetChannelIdxByName(&device->RealOut, FrontCenter); + assert(lidx >= 0 && ridx >= 0 && cidx >= 0); - if(device->Stablizer) - { - int lidx = GetChannelIdxByName(&device->RealOut, FrontLeft); - int ridx = GetChannelIdxByName(&device->RealOut, FrontRight); - int cidx = GetChannelIdxByName(&device->RealOut, FrontCenter); - assert(lidx >= 0 && ridx >= 0 && cidx >= 0); + ApplyStablizer(device->Stablizer, device->RealOut.Buffer, lidx, ridx, cidx, + SamplesToDo, device->RealOut.NumChannels); + } - ApplyStablizer(device->Stablizer, Buffer, lidx, ridx, cidx, - SamplesToDo, Channels); - } + ApplyDistanceComp(device->RealOut.Buffer, device->ChannelDelay, device->TempBuffer[0], + SamplesToDo, device->RealOut.NumChannels); - ApplyDistanceComp(Buffer, device->ChannelDelay, device->TempBuffer[0], - SamplesToDo, Channels); + if(device->Limiter) + ApplyCompression(device->Limiter, device->RealOut.NumChannels, SamplesToDo, + device->RealOut.Buffer); - if(device->Limiter) - ApplyCompression(device->Limiter, Channels, SamplesToDo, Buffer); + if(device->DitherDepth > 0.0f) + ApplyDither(device->RealOut.Buffer, &device->DitherSeed, device->DitherDepth, + SamplesToDo, device->RealOut.NumChannels); - if(device->DitherDepth > 0.0f) - ApplyDither(Buffer, &device->DitherSeed, device->DitherDepth, SamplesToDo, - Channels); + if(OutBuffer) + { + ALfloat (*Buffer)[BUFFERSIZE] = device->RealOut.Buffer; + ALsizei Channels = device->RealOut.NumChannels; switch(device->FmtType) { |