mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-19 09:41:32 +08:00
UI: Remove whitespace from end of autconfig stream key
Because ?bandwidthtest is being appended to the end, it would bypass normal whitespace removal, causing the stream key to fail.
This commit is contained in:
@@ -146,6 +146,17 @@ void AutoConfigTestPage::GetServers(std::vector<ServerInfo> &servers)
|
||||
obs_properties_destroy(ppts);
|
||||
}
|
||||
|
||||
static inline void string_depad_key(string &key)
|
||||
{
|
||||
while (!key.empty()) {
|
||||
char ch = key.back();
|
||||
if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')
|
||||
key.pop_back();
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AutoConfigTestPage::TestBandwidthThread()
|
||||
{
|
||||
bool connected = false;
|
||||
@@ -205,8 +216,10 @@ void AutoConfigTestPage::TestBandwidthThread()
|
||||
obs_data_release(output_settings);
|
||||
|
||||
std::string key = wiz->key;
|
||||
if (wiz->service == AutoConfig::Service::Twitch)
|
||||
if (wiz->service == AutoConfig::Service::Twitch) {
|
||||
string_depad_key(key);
|
||||
key += "?bandwidthtest";
|
||||
}
|
||||
|
||||
obs_data_set_string(service_settings, "service",
|
||||
wiz->serviceName.c_str());
|
||||
|
||||
Reference in New Issue
Block a user