From 27ca90646d73211a4d2cd5714a7216b45a8d71fd Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 3 Jul 2023 09:42:30 -0400 Subject: [PATCH] WebContent: Clear Serenity's audio buffers when seeking Without this, the already-buffered audio may continue playing after a seek. The SoundPlayer application does the same operation here. --- Userland/Services/WebContent/AudioCodecPluginSerenity.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Services/WebContent/AudioCodecPluginSerenity.cpp b/Userland/Services/WebContent/AudioCodecPluginSerenity.cpp index 794e0fe463..cb5867050e 100644 --- a/Userland/Services/WebContent/AudioCodecPluginSerenity.cpp +++ b/Userland/Services/WebContent/AudioCodecPluginSerenity.cpp @@ -92,6 +92,9 @@ void AudioCodecPluginSerenity::seek(double position) { m_position = set_loader_position(m_loader, position, m_duration); + m_connection->clear_client_buffer(); + m_connection->async_clear_buffer(); + if (on_playback_position_updated) on_playback_position_updated(m_position); }