From faf73319999105c7f26673dc65a24f4efccad83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Fri, 25 Mar 2022 20:23:35 +0100 Subject: [PATCH] SoundPlayer: Don't crash when the reported buffer is unexpected It seems like this happens in quite some valid situations, so my initially sensible failsafe doesn't make sense. As the buffer system is hopefully gone soon, it won't be an issue in the future either way. --- Userland/Applications/SoundPlayer/PlaybackManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.cpp b/Userland/Applications/SoundPlayer/PlaybackManager.cpp index c8e53684ac6..bbaf720a341 100644 --- a/Userland/Applications/SoundPlayer/PlaybackManager.cpp +++ b/Userland/Applications/SoundPlayer/PlaybackManager.cpp @@ -20,7 +20,9 @@ PlaybackManager::PlaybackManager(NonnullRefPtr conn m_connection->on_finish_playing_buffer = [this](auto finished_buffer) { auto last_buffer_in_queue = m_enqueued_buffers.dequeue(); // A fail here would mean that the server skipped one of our buffers, which is BAD. - VERIFY(last_buffer_in_queue == finished_buffer); + if (last_buffer_in_queue != finished_buffer) + dbgln("Never heard back about buffer {}, what happened?", last_buffer_in_queue); + next_buffer(); }; m_timer->stop();