Repository navigation
fix(media player): hold typefind back when a stinger clip loads paused - #1076
Merged
Merged
Conversation
A clip loaded paused (every stinger cue) went up from READY with a plain set_state, outside up_from_ready, so the typefind hold from #963 did not apply. On the Windows runner typefind then raced the state change: the clip's stream reached decodebin3 while it was still changing state, got FLUSHING and stayed stuck, and the clip never parked (#1069). The cue also loads a clip again once when no frame has parked within CUE_TIMEOUT, so a stinger no longer stays unready for good. Drops the Windows skips for #1069. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
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.
Closes #1069
Problem
On the Windows CI runner a stinger clip source now and then never parked its clip, so the stinger stayed unready. Nine stinger tests were skipped on Windows for it (#1067, #1071).
The cause:
load_current_file_innerloads a clip that should stay paused (every stinger cue does) with a plainpipeline.set_state(Paused)from READY. That bypassesup_from_ready, so the typefind hold from #963 did not apply on that path. Typefind then raced the state change. The clip's stream reacheddecodebin3while it was still changing state, the push returnedFLUSHING, and urisourcebin's multiqueue stopped pushing for good. No pad was added, no frame reached the park clocksync, and the cue timed out afterCUE_TIMEOUT(5 s). With heavier timing (more logging) the same race showed as typefind never completing.Change
up_from_ready, asstartalready does.CUE_TIMEOUT, the cue loads the clip again once (reload_unparked). Before this, a clip whose stream never reached the bridge left the stinger unready until an operator reloaded it by hand. The reload is skipped when the frame arrives meanwhile, when another clip was cued, or when the pipeline stopped.stall_next_clip_for_tests(flow, block_id)drops the next clip's video before the park clocksync. It is keyed on(flow_id, block_id), and the bridge checks it with one relaxed atomic load per new chain.a_take_that_fails_to_program_leaves_the_old_source_on_airkeeps a Windows skip for a different flake (the old source's first frames miss, seen on the runner while tracing this).Rejected:
CUE_TIMEOUT: the stream never recovers on its own.Evidence
stinger_testrepeatedly with dot dumps, pad dumps andcdbstacks; the findings are in Stinger clip source sometimes never parks its first clip on Windows #1069. The dumps showdecodebin3's inputidentityblocked and unlinked,last_flow_resultFlushingfrom urisourcebin's src pad up through the demuxer, and nounblock_streamsfor that decodebin3. Every GStreamer thread was idle; there was no deadlock.a_clip_that_delivers_no_frame_is_loaded_againfails with the reload disabled (stinger never ready: ... parked false) and passes with it (7.6 s: one 5 s timeout, then parked and a full take).Tests
Ran, on macOS:
cargo clippy --all-targets -- -D warnings: clean.cargo test --test stinger_test a_clip_that_delivers_no_frame_is_loaded_again: passes with the change, fails with the reload disabled (both runs above).cargo test --test stinger_test: 12 passed, 2 failed in one run.gpu_stingers_land_frame_accuratelyfails the same way on main's code locally (2 of 2 runs), the known macOS failure.cpu_stingers_play_classicfailed once and then passed 3 of 3 reruns. On main's code it passed 2 of 2.cargo test --test stinger_api_test: 9 passed.Skipped: nothing locally; the skip switch is only set in CI.
Not run: the full suite locally. Windows runs through this PR's
ci:windowsjob.For the reviewer
CUE_TIMEOUTmore before a cue gives up, and it runs only when the first attempt produced nothing.up_from_readyholds typefind back on one more path. That path isload_current_file_innerwithplay = false: stinger cues, and any other caller that loads a clip paused.🤖 Generated with Claude Code