From 23bc306f9918e5852c9a736cd5820e033dff2f13 Mon Sep 17 00:00:00 2001 From: Joel Petersson Date: Tue, 2 May 2023 22:35:05 +0200 Subject: [PATCH] SoundPlayer: Clear client buffer when playback is stopped Previously we would not clear the client buffer of the ConnectionToServer when playback was stopped. This would cause old samples to be buffered and played when playback was restarted. With this commit we now perform this clearing of the client buffer correctly. --- Userland/Applications/SoundPlayer/PlaybackManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.cpp b/Userland/Applications/SoundPlayer/PlaybackManager.cpp index 3f0f81182b..d192fdb19c 100644 --- a/Userland/Applications/SoundPlayer/PlaybackManager.cpp +++ b/Userland/Applications/SoundPlayer/PlaybackManager.cpp @@ -37,6 +37,7 @@ void PlaybackManager::set_loader(NonnullRefPtr&& loader) void PlaybackManager::stop() { set_paused(true); + m_connection->clear_client_buffer(); m_connection->async_clear_buffer(); if (m_loader)