diff options
author | Chris Robinson <[email protected]> | 2018-03-01 16:16:37 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-03-01 16:16:37 -0800 |
commit | 4b85104c4f7ba4b78a36931672124f69f4f17711 (patch) | |
tree | 5d58fccf139cf9283fd058b9229f5da853ecbc2a /Alc/ALu.c | |
parent | 0d91d63cf32357853587be5227be3c1319fc2fba (diff) |
Apply the limiter, distance comp, and others even with no output buffer
Diffstat (limited to 'Alc/ALu.c')
-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) { |