mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
AudioServer: Stop re-creating the device stream buffer
The buffer provided to `OutputMemoryStream` was made a private class member. This is because there is no reason to re-create it in every iteration. Also, the logic becomes more symmetric with `m_zero_filled_buffer` which is already a class member.
This commit is contained in:
parent
b22c840963
commit
457fda6354
2 changed files with 2 additions and 2 deletions
|
@ -100,8 +100,7 @@ void Mixer::mix()
|
|||
if (m_muted || m_main_volume < 0.01) {
|
||||
m_device->write(m_zero_filled_buffer.data(), static_cast<int>(m_zero_filled_buffer.size()));
|
||||
} else {
|
||||
Array<u8, HARDWARE_BUFFER_SIZE_BYTES> buffer;
|
||||
OutputMemoryStream stream { buffer };
|
||||
OutputMemoryStream stream { m_stream_buffer };
|
||||
|
||||
for (auto& mixed_sample : mixed_buffer) {
|
||||
mixed_sample.log_multiply(static_cast<float>(m_main_volume));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue