UI: Move code out of unnamed lambdas

This is in preparation of the next change, to hopefully minimize
the resulting diff
This commit is contained in:
Ruwen Hahn
2024-07-09 13:25:49 +02:00
committed by Ryan Foster
parent 5545674e6d
commit b74e7ede0e
2 changed files with 152 additions and 175 deletions

View File

@@ -7109,8 +7109,7 @@ void OBSBasic::StartStreaming()
sysTrayStream->setText("Basic.Main.PreparingStream");
}
auto holder = outputHandler->SetupStreaming(service);
auto future = holder.future.then(this, [&](bool setupStreamingResult) {
auto finish_stream_setup = [&](bool setupStreamingResult) {
if (!setupStreamingResult) {
DisplayStreamStartError();
return;
@@ -7152,7 +7151,10 @@ void OBSBasic::StartStreaming()
if (!autoStartBroadcast)
OBSBasic::ShowYouTubeAutoStartWarning();
#endif
});
};
auto holder = outputHandler->SetupStreaming(service);
auto future = holder.future.then(this, finish_stream_setup);
startStreamingFuture = {holder.cancelAll, future};
}