Repository navigation
test: Bound the playing-seek media time by the time that passed - #1766
Merged
Merged
Conversation
playing_seek_between_keyframes seeks while the video plays, waits for the first frame, then reads the media time and required it to be at most 500 ms past the target. The video keeps playing while the test waits, so a slow runner that takes longer than that to show and report the first frame failed it although the seek was right (macOS Tier 2: first frame 135, the target frame, but media time 5100 ms for a 4500 ms seek). The upper bound is now the target plus the real time between the seek and reading the media time, plus the existing two-frame slack. The first-frame check and the lower bound are unchanged, and a media time that runs ahead of real playback still fails. With a 700 ms sleep injected before reading the media time, the old bound fails (5266 ms for 4500 ms) and the new one passes (740 ms elapsed). Fixes obs-rust#1765
zackees
approved these changes
Oct 22, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Looks right. The upper bound is now the wall time that passed since the seek, plus slack, instead of a fixed 500 ms. The lower bound and the frame check are unchanged, so it still catches a seek that lands short or shows the wrong frame. This fixes a timing flake and doesn't loosen what the port has to do. Queued.
This was referenced Oct 22, 2026
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 22, 2026
…s-rust#1775) obs-rust#1766 bounded the media time read after a playing seek by the target plus the real time that passed plus two frames. A playing source decodes ahead, so the time it reports can run ahead of the frame it shows, and on a fast runner that exceeds two frames: macOS Tier 2 saw 4666 ms for a 4500 ms seek 97 ms after it (limit 4663 ms), with the right first frame. Locally it runs 66 ms ahead after 40 ms. Keep both allowances: the elapsed time for a slow runner, plus the 500 ms the test allowed before obs-rust#1766 for running ahead. The first-frame check and the lower bound are unchanged. Fixes obs-rust#1774
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
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.
Fixes #1765
What and why
playing_seek_between_keyframes(from #479) seeks while the video plays, waits for the first frame, then reads the media time. It required that time to be at most 500 ms past the target. The video keeps playing while the test waits, so a slow runner fails it even when the seek is right. macOS Tier 2 on #1721 (run 39726924020, attempt 2, job 119704244848):Frame 135 is the target frame. The upper bound is now the target plus the real time between the seek and reading the media time, plus the existing two-frame slack (
TIME_SLACK_MS). The first-frame check and the lower bound are unchanged, and a media time that runs ahead of real playback still fails. The diagnostic line now also prints the elapsed time.RED → GREEN
os_sleep_ms()injected betweenwait_first_frame()andmedia_playback_get_current_time(), which simulates the slow runner. The old bound fails:seek to 4500 ms reports a media time of 5266 ms.media time 5266 ms, 740 ms after the seek).OBS_LIBOBS_BACKEND=C), 20/20 on hybrid Rust libobs, 10/10 onlibobs-c-reference.uv run ci/local_gate.py --lane lintis ok.Checklist
masterdocs/features.mdis added or updated (not applicable: test only)-W..., ratchets): noneAI note: Claude Code (Claude Opus 5.5) wrote the change, the commit message and this text under the submitter's direction, and ran the tests above on the submitter's machines.