Skip to content

Commit

Permalink
Pass a span to ApplyDistanceComp
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 24, 2024
1 parent 6b2df6a commit 5be62e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions alc/alu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2009,10 +2009,11 @@ void ProcessContexts(DeviceBase *device, const uint SamplesToDo)


void ApplyDistanceComp(const al::span<FloatBufferLine> Samples, const size_t SamplesToDo,
const DistanceComp::ChanData *distcomp)
const al::span<const DistanceComp::ChanData,MaxOutputChannels> chandata)
{
ASSUME(SamplesToDo > 0);

auto distcomp = chandata.begin();
for(auto &chanbuffer : Samples)
{
const float gain{distcomp->Gain};
Expand Down Expand Up @@ -2163,7 +2164,7 @@ uint DeviceBase::renderSamples(const uint numSamples)

/* Apply delays and attenuation for mismatched speaker distances. */
if(ChannelDelays)
ApplyDistanceComp(RealOut.Buffer, samplesToDo, ChannelDelays->mChannels.data());
ApplyDistanceComp(RealOut.Buffer, samplesToDo, ChannelDelays->mChannels);

/* Apply dithering. The compressor should have left enough headroom for the
* dither noise to not saturate.
Expand Down

0 comments on commit 5be62e2

Please sign in to comment.