Browse Source

UI: Fix autoconfig capping bitrate with "custom server"

When custom server is used, it would still use the "common" RTMP service
to cap its bitrate.  So if Twitch was selected and you changed over to
custom RTMP server, it would still cap to Twitch's bitrate limits even
though you're not using Twitch anymore.
jp9000 8 years ago
parent
commit
8416c9fbae
1 changed files with 12 additions and 5 deletions
  1. 12 5
      UI/window-basic-auto-config.cpp

+ 12 - 5
UI/window-basic-auto-config.cpp

@@ -274,15 +274,22 @@ bool AutoConfigStreamPage::validatePage()
 {
 {
 	OBSData service_settings = obs_data_create();
 	OBSData service_settings = obs_data_create();
 	obs_data_release(service_settings);
 	obs_data_release(service_settings);
-	obs_data_set_string(service_settings, "service",
-			QT_TO_UTF8(ui->service->currentText()));
 
 
-	OBSService service = obs_service_create("rtmp_common", "temp_service",
+	wiz->customServer = ui->streamType->currentIndex() == 1;
+
+	const char *serverType = wiz->customServer
+		? "rtmp_custom"
+		: "rtmp_common";
+
+	if (!wiz->customServer) {
+		obs_data_set_string(service_settings, "service",
+				QT_TO_UTF8(ui->service->currentText()));
+	}
+
+	OBSService service = obs_service_create(serverType, "temp_service",
 			service_settings, nullptr);
 			service_settings, nullptr);
 	obs_service_release(service);
 	obs_service_release(service);
 
 
-	wiz->customServer = ui->streamType->currentIndex() == 1;
-
 	int bitrate = 10000;
 	int bitrate = 10000;
 	if (!ui->doBandwidthTest->isChecked()) {
 	if (!ui->doBandwidthTest->isChecked()) {
 		bitrate = ui->bitrate->value();
 		bitrate = ui->bitrate->value();