mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 17:48:37 +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
Notes:
sideshowbarker
2024-07-17 04:33:59 +09:00
Author: https://github.com/achronop
Commit: 457fda6354
Pull-request: https://github.com/SerenityOS/serenity/pull/16003
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
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