Restore to user configured output name after probing

This commit is contained in:
Yukino Song
2024-09-21 23:22:24 +08:00
parent 79c9c23232
commit 4d5cc526b5

View File

@@ -161,8 +161,13 @@ namespace proc {
// Ensure starting from a clean slate
terminate();
// Save the original output name in case we modify it temporary later
std::string output_name_orig = config::video.output_name;
// Executed when returning from function
auto fg = util::fail_guard([&]() {
// Restore to user defined output name
config::video.output_name = output_name_orig;
terminate();
});
@@ -442,6 +447,9 @@ namespace proc {
fg.disable();
// Restore to user defined output name
config::video.output_name = output_name_orig;
#if defined SUNSHINE_TRAY && SUNSHINE_TRAY >= 1
system_tray::update_tray_playing(_app.name);
#endif