From 6f6a88ad327785e8c76e6e870a969eff765cc31c Mon Sep 17 00:00:00 2001 From: jayki Date: Mon, 21 Dec 2020 18:02:55 +0100 Subject: [PATCH] Store config in Profile Do not merge, keeps crashing OBS on destructor (SaveSetting()) :( --- src/virtual-output/virtual_properties.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/virtual-output/virtual_properties.cpp b/src/virtual-output/virtual_properties.cpp index b8608d2..f5ba5b1 100644 --- a/src/virtual-output/virtual_properties.cpp +++ b/src/virtual-output/virtual_properties.cpp @@ -22,7 +22,7 @@ VirtualProperties::VirtualProperties(QWidget *parent) : connect(ui->checkBox_keepratio, SIGNAL(stateChanged(int)), this, SLOT(onClickKeepAspectRatio())); - config_t* config = obs_frontend_get_global_config(); + config_t* config = obs_frontend_get_profile_config(); config_set_default_bool(config, "VirtualOutput", "AutoStart", false); config_set_default_bool(config, "VirtualOutput", "HoriFlip", false); config_set_default_bool(config, "VirtualOutput", "KeepRatio", false); @@ -140,15 +140,17 @@ void VirtualProperties::closeEvent(QCloseEvent *event) void VirtualProperties::SaveSetting() { - config_t* config = obs_frontend_get_global_config(); + config_t* config = obs_frontend_get_profile_config(); if (config) { bool autostart = ui->checkBox_auto->isChecked(); bool hori_flip = ui->checkBox_horiflip->isChecked(); bool keep_ratio = ui->checkBox_keepratio->isChecked(); int delay = ui->horizontalSlider->value(); + int target = ui->comboBox_target->currentIndex(); config_set_bool(config, "VirtualOutput", "AutoStart", autostart); config_set_bool(config, "VirtualOutput", "HoriFlip", hori_flip); config_set_bool(config, "VirtualOutput", "KeepRatio", keep_ratio); config_set_int(config, "VirtualOutput", "OutDelay", delay); + config_set_int(config, "VirtualOutput", "Target", target); } -} \ No newline at end of file +}