Skip to content

fix: keep what a seek decoded at the new position - #433

Merged
devopvoid merged 1 commit into
mainfrom
fix/media-seek-flush
Oct 24, 2026
Merged

devopvoid merged 1 commit into
mainfrom
fix/media-seek-flush

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

MediaPlayer::Seek flushed the pacer after releasing its lock. When the decode thread carried out the seek in between and decoded at the new position, the late flush threw that away. An audio source, decoded seconds ahead, then skipped ahead or ended at once. The flush now happens under the lock the decode thread takes the request with.

This is what made MediaPlayerTest.positionFollowsABackwardSeekOfAudio fail now and then (1.19 s on linux_arm64, 3.9 s on windows_x86_64). The test now also checks that playback goes on after the seek.

MediaPlayer::Seek flushed the pacer after releasing its lock. When the decode thread performed the seek in between and decoded at the new position, that flush threw it away: an audio source, decoded seconds ahead, skipped ahead or ended at once. The flush now happens under the lock the decode thread takes the request with. This made MediaPlayerTest.positionFollowsABackwardSeekOfAudio fail now and then, which now also checks that playback goes on.
@devopvoid
devopvoid merged commit 04d5bac into main Oct 24, 2026
22 checks passed
@devopvoid
devopvoid deleted the fix/media-seek-flush branch October 24, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant