Clear the whole buffer

This commit is contained in:
Chris Robinson
2020-05-12 04:46:15 -07:00
parent 2f8f829772
commit ad95cb6312
+2 -4
View File
@@ -1728,7 +1728,7 @@ void ProcessContexts(ALCdevice *device, const ALuint SamplesToDo)
for(ALeffectslot *slot : auxslots)
{
for(auto &buffer : slot->MixBuffer)
std::fill_n(buffer.begin(), SamplesToDo, 0.0f);
buffer.fill(0.0f);
}
/* Process voices that have a playing source. */
@@ -2018,9 +2018,7 @@ void aluMixData(ALCdevice *device, void *OutBuffer, const ALuint NumSamples,
/* Clear main mixing buffers. */
std::for_each(device->MixBuffer.begin(), device->MixBuffer.end(),
[SamplesToDo](FloatBufferLine &buffer) -> void
{ std::fill_n(buffer.begin(), SamplesToDo, 0.0f); }
);
[](FloatBufferLine &buffer) -> void { buffer.fill(0.0f); });
/* Increment the mix count at the start (lsb should now be 1). */
IncrementRef(device->MixCount);