Pin current display when monitors are added/removed

This commit is contained in:
Yukino Song
2024-08-24 15:41:35 +08:00
parent ad42ef4131
commit 19630a9cb5
2 changed files with 16 additions and 24 deletions

View File

@@ -246,6 +246,14 @@ namespace proc {
}
#endif
// 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,
// or any number of other factors).
if (video::probe_encoders()) {
return 503;
}
// Add Stream-specific environment variables
_env["SUNSHINE_APP_ID"] = _app.id;
_env["SUNSHINE_APP_NAME"] = _app.name;
@@ -290,14 +298,6 @@ namespace proc {
#endif
}
// 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,
// or any number of other factors).
if (video::probe_encoders()) {
return 503;
}
std::error_code ec;
_app_prep_begin = std::begin(_app.prep_cmds);
_app_prep_it = _app_prep_begin;