AudioServer: Stop glitching when toggling mute

Initialize the `AudioServer::Mixer::m_zero_filled_buffer` to zero. The
garbage memory inside that buffer was causing a glitch sound when the
user was toggling the mute checkbox or was moving the volume slider on
and off zero. Glitching was more obvious if the toggling was happening
without any sound being played in parallel.

In addition to that, the `m_zero_filled_buffer` turned to `const` since
there is no intention to modify its content.
This commit is contained in:
Alex Chronopoulos 2022-11-09 22:13:59 +01:00 committed by Andrew Kaster
commit b22c840963
Notes: sideshowbarker 2024-07-17 07:31:31 +09:00

View file

@ -133,7 +133,7 @@ private:
NonnullRefPtr<Core::ConfigFile> m_config;
RefPtr<Core::Timer> m_config_write_timer;
Array<u8, HARDWARE_BUFFER_SIZE_BYTES> m_zero_filled_buffer;
Array<u8, HARDWARE_BUFFER_SIZE_BYTES> const m_zero_filled_buffer {};
void mix();
};