From 8dff07ad46ab6cea4db01c02e386c7a90a480e0b Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 17 May 2017 22:31:02 -0700 Subject: [PATCH] UI: Fix cases where wizard bitrate is not capped Fixes some cases where the maximum bitrate might not be capped by the service selection as it's supposed to be. --- UI/window-basic-auto-config-test.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-auto-config-test.cpp b/UI/window-basic-auto-config-test.cpp index 724ae5c86..6cb1db7a9 100644 --- a/UI/window-basic-auto-config-test.cpp +++ b/UI/window-basic-auto-config-test.cpp @@ -240,12 +240,12 @@ void AutoConfigTestPage::TestBandwidthThread() /* -----------------------------------*/ /* apply settings */ + obs_service_update(service, service_settings); obs_service_apply_encoder_settings(service, vencoder_settings, aencoder_settings); obs_encoder_update(vencoder, vencoder_settings); obs_encoder_update(aencoder, aencoder_settings); - obs_service_update(service, service_settings); obs_output_update(output, output_settings); /* -----------------------------------*/ @@ -885,6 +885,30 @@ void AutoConfigTestPage::FinalizeResults() }; if (wiz->type != AutoConfig::Type::Recording) { + const char *serverType = wiz->customServer + ? "rtmp_custom" + : "rtmp_common"; + + OBSService service = obs_service_create(serverType, + "temp_service", nullptr, nullptr); + obs_service_release(service); + + OBSData service_settings = obs_data_create(); + OBSData vencoder_settings = obs_data_create(); + obs_data_release(service_settings); + obs_data_release(vencoder_settings); + + obs_data_set_int(vencoder_settings, "bitrate", + wiz->idealBitrate); + + obs_data_set_string(service_settings, "service", + wiz->serviceName.c_str()); + obs_service_apply_encoder_settings(service, + vencoder_settings, nullptr); + + wiz->idealBitrate = (int)obs_data_get_int(vencoder_settings, + "bitrate"); + if (!wiz->customServer) form->addRow( newLabel("Basic.AutoConfig.StreamPage.Service"),