From cb6d23e297d65380de4e11fc1daf8137ab12ce46 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 30 Oct 2026 12:39:06 +0200 Subject: [PATCH] [GStreamer] A flushing seek leaves readyState stuck at HAVE_CURRENT_DATA https://bugs.webkit.org/show_bug.cgi?id=329629 Reviewed by NOBODY (OOPS!). updateStates() delays a buffering change seen during an asynchronous state change, so a transition into buffering survives while the pipeline settles. The guard tested only that m_wasBuffering and m_isBuffering differ, so it also acted on the reverse pair. m_wasBuffering is written only by updateBufferingStatus(), so once the initial buffering completes it stays true while m_isBuffering is false. A later flushing seek drives an asynchronous state change with that stale pair, and the guard copies m_wasBuffering into m_isBuffering, putting the player back into buffering. The download has finished, so no further buffering message arrives to lift it, and readyState stays at HAVE_CURRENT_DATA until the media ends. Act on the guard only for a transition into buffering, the case it exists to preserve. * Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateStates): --- .../platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp @@ -3144,7 +3144,7 @@ void MediaPlayerPrivateGStreamer::update // Delay the m_isBuffering change by returning it to its previous value. Without this, the false --> true change // would go unnoticed by the code that should trigger a pause. - if (m_wasBuffering != m_isBuffering && !m_isPaused && m_playbackRate) { + if (!m_wasBuffering && m_isBuffering && !m_isPaused && m_playbackRate) { GST_TRACE_OBJECT(pipeline(), "[Buffering] Delaying m_isBuffering %s --> %s to force the proper change from not buffering to buffering when the async state change completes.", boolForPrinting(m_wasBuffering), boolForPrinting(m_isBuffering)); m_isBuffering = m_wasBuffering; m_bufferingPercentage = m_previousBufferingPercentage;