fix(video): wait for a configured output to appear before falling back#1514
Open
ryancatlin wants to merge 1 commit into
Open
fix(video): wait for a configured output to appear before falling back#1514ryancatlin wants to merge 1 commit into
ryancatlin wants to merge 1 commit into
Conversation
refresh_displays() reset to the first display and returned immediately when the configured output_name was absent from the freshly enumerated list. With an on-demand virtual display (a headless connector brought up only for a stream) that connector can still be settling in the compositor at the instant the encoder binds, so Apollo would latch onto the wrong physical monitor for the entire session and never recover (the wrong name gets cached in proc::proc.display_name). When the missing display is the explicitly pinned output_name, re-poll Apollo's own display_names() up to ~2s (10 x 200ms) before falling back. Bounded, so a genuinely-absent output still degrades to the old behaviour rather than hanging; zero cost when the output is already present.
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.
Problem
When
output_namepoints at a display that is momentarily absent from theenumeration at stream-bind time,
refresh_displays()resets to the firstdisplay and returns immediately. The capture then opens that fallback monitor,
caches its name in
proc::proc.display_name, and never re-evaluates — so theentire session streams the wrong output with no recovery.
This reliably bites on-demand virtual displays (a headless connector brought up
only for a stream), which can still be settling in the compositor at the instant
the encoder binds. It can also surface with displays returning from DPMS or
ordinary hotplug timing.
Fix
When the missing display is the explicitly configured
output_name, give it ashort grace window (~2s, 10 × 200ms) — re-enumerating
platf::display_names()each attempt — before falling back.
rather than hanging.
single-pass behaviour.
and can lag the compositor's view.