From 474073955bd76f868d97a4fb587ec4c37b29f7f7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 4 Jul 2019 17:00:01 -0700 Subject: [PATCH] Pass a span to ApplyStablizer --- Alc/alu.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Alc/alu.cpp b/Alc/alu.cpp index b12559d7..f5c3b842 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -1429,16 +1429,16 @@ void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo) } -void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const ALuint lidx, - const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo, const ALuint NumChannels) +void ApplyStablizer(FrontStablizer *Stablizer, const al::span Buffer, + const ALuint lidx, const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo) { ASSUME(SamplesToDo > 0); - ASSUME(NumChannels > 0); /* Apply a delay to all channels, except the front-left and front-right, so * they maintain correct timing. */ - for(ALuint i{0};i < NumChannels;i++) + const size_t NumChannels{Buffer.size()}; + for(size_t i{0u};i < NumChannels;i++) { if(i == lidx || i == ridx) continue; @@ -1684,8 +1684,7 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples) const int cidx{GetChannelIdxByName(device->RealOut, FrontCenter)}; assert(lidx >= 0 && ridx >= 0 && cidx >= 0); - ApplyStablizer(device->Stablizer.get(), RealOut.data(), lidx, ridx, cidx, SamplesToDo, - static_cast(RealOut.size())); + ApplyStablizer(device->Stablizer.get(), RealOut, lidx, ridx, cidx, SamplesToDo); } /* Apply compression, limiting sample amplitude if needed or desired. */