Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9a0ed144d41268b28ec6e7ee0f11837735ba1cf7
      
https://github.com/WebKit/WebKit/commit/9a0ed144d41268b28ec6e7ee0f11837735ba1cf7
  Author: Enrique Ocaña González <eoca...@igalia.com>
  Date:   2025-08-07 (Thu, 07 Aug 2025)

  Changed paths:
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
    M 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp
    M 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h

  Log Message:
  -----------
  [MSE][GStreamer] don't push samples while seeking
https://bugs.webkit.org/show_bug.cgi?id=295415

Reviewed by Alicia Boya Garcia.

MediaSource::waitForTarget completes asynchronously. Even when the
target time is already buffered, it still enqueues a task to compute
seek time on next event loop cycle. This can lead to SourceBuffer
providing media data for incorrect time, after GStreamer seek already
flushed the source. For example this happens if
TrackQueue::LowLevelHandler callback was posted just before the seek.

The proposed change implements SourceBufferPrivate::isSeeking() that
returns true until MSE seek is completed, effectivly blocking
SourceBufferPrivate::provideMediaData during the seek.

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1528

Original author: Eugene Mutavchi <ievgen_mutav...@comcast.com>

* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Signal the seek intent to 
the media source private.
* 
Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
(WebCore::MediaSourcePrivateGStreamer::willSeek): Forward the seek intent to 
all SourceBufferPrivates.
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: 
Added willSeek().
* 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::willSeek): Set m_isSeeking to true.
(WebCore::SourceBufferPrivateGStreamer::isSeeking const): Return m_isSeeking 
value.
(WebCore::SourceBufferPrivateGStreamer::seekToTime): Unset m_isSeeking and call 
the default SourceBufferPrivate seekToTime() implementation.
* 
Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 
Added willSeek(), isSeeking(), seekToTime() and the m_isSeeking flag (to signal 
that we're waiting for samples from the multiplatform layer after a seek has 
been initiated; unset once the samples are ready for the platform-specific 
layer).

Canonical link: https://commits.webkit.org/298330@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to