fix(video): prevent encoder probing with no active displays (#3592)

This commit is contained in:
Lukas Senionis 2025-01-27 01:21:15 +02:00 committed by GitHub
commit 0631472533
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 37 additions and 6 deletions

View file

@ -852,14 +852,14 @@ namespace nvhttp {
auto launch_session = make_launch_session(host_audio, args);
if (rtsp_stream::session_count() == 0) {
// The display should be restored in case something fails as there are no other sessions.
revert_display_configuration = true;
// We want to prepare display only if there are no active sessions at
// the moment. This should be done before probing encoders as it could
// change the active displays.
display_device::configure_display(config::video, *launch_session);
// The display should be restored in case something fails as there are no other sessions.
revert_display_configuration = true;
// Probe encoders again before streaming to ensure our chosen
// encoder matches the active GPU (which could have changed
// due to hotplugging, driver crash, primary monitor change,