From 4d5cc526b51e45ed5bb3de6ec4721a1614404c67 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Sat, 21 Sep 2024 23:22:24 +0800 Subject: [PATCH] Restore to user configured output name after probing --- src/process.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/process.cpp b/src/process.cpp index d56357ac..a88f8845 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -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