Skip to content

Commit

Permalink
UI: Only cache multitrack config URL startup argument
Browse files Browse the repository at this point in the history
  • Loading branch information
palana authored and RytoEX committed Jun 19, 2024
1 parent a9b5968 commit 8a8019d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions UI/goliveapi-network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,27 @@ GoLiveApi::Config DownloadGoLiveConfig(QWidget *parent, QString url,

QString MultitrackVideoAutoConfigURL(obs_service_t *service)
{
static const QString url = [service]() -> QString {
static const std::optional<QString> cli_url =
[]() -> std::optional<QString> {
auto args = qApp->arguments();
for (int i = 0; i < args.length() - 1; i++) {
if (args[i] == "--config-url" &&
args.length() > (i + 1)) {
return args[i + 1];
}
}
OBSDataAutoRelease settings = obs_service_get_settings(service);
return obs_data_get_string(
settings, "multitrack_video_configuration_url");
return std::nullopt;
}();

QString url;
if (cli_url.has_value()) {
url = *cli_url;
} else {
OBSDataAutoRelease settings = obs_service_get_settings(service);
url = obs_data_get_string(settings,
"multitrack_video_configuration_url");
}

blog(LOG_INFO, "Go live URL: %s", url.toUtf8().constData());
return url;
}

0 comments on commit 8a8019d

Please sign in to comment.