forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 150
[MSE][GStreamer] don't push samples while seeking #1528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
emutavchi
wants to merge
1
commit into
WebPlatformForEmbedded:wpe-2.46
Choose a base branch
from
emutavchi:wpe-2.46-mse-seek-fix
base: wpe-2.46
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[MSE][GStreamer] don't push samples while seeking #1528
emutavchi
wants to merge
1
commit into
WebPlatformForEmbedded:wpe-2.46
from
emutavchi:wpe-2.46-mse-seek-fix
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
eocanha
added a commit
to eocanha/WebKit
that referenced
this pull request
Jul 3, 2025
https://bugs.webkit.org/show_bug.cgi?id=295415 Reviewed by NOBODY (OOPS!). 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: WebPlatformForEmbedded/WPEWebKit#1528 Original author: Eugene Mutavchi <[email protected]> * 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.
Submitted the patch for upstream review as https://bugs.webkit.org/show_bug.cgi?id=295415 / WebKit/WebKit#47564 |
Hi @eocanha, any progress here? |
It's still pending for upstream review, but the reviewer with the most appropriate knowledge to review it is currently busy with a higher priority performance regression in wpe-2.46. |
Thanks for the update @eocanha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.