Skip to content

[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
wants to merge 1 commit into
base: wpe-2.46
Choose a base branch
from

Conversation

emutavchi
Copy link
Collaborator

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.

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.
@emutavchi emutavchi requested a review from philn as a code owner June 27, 2025 18:54
@philn philn requested review from eocanha and removed request for philn June 29, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants