瀏覽代碼

UI: Fix proprty Undo not updating settings properly

Settings would not update properly because obs_source_update() can only
apply the settings value to the existing settings, so it could not
remove values. This change fully erases existing settings and replaces
it with the target settings instead.
jp9000 4 年之前
父節點
當前提交
b685d1bf88
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      UI/context-bar-controls.cpp
  2. 1 1
      UI/window-basic-properties.cpp

+ 1 - 1
UI/context-bar-controls.cpp

@@ -58,7 +58,7 @@ void SourceToolbar::SetUndoProperties(obs_source_t *source)
 		obs_data_t *settings = obs_data_create_from_json(data.c_str());
 		obs_source_t *source = obs_get_source_by_name(
 			obs_data_get_string(settings, "undo_sname"));
-		obs_source_update(source, settings);
+		obs_source_reset_settings(source, settings);
 
 		obs_source_t *scene_source =
 			obs_get_source_by_name(scene_name.c_str());

+ 1 - 1
UI/window-basic-properties.cpp

@@ -368,7 +368,7 @@ void OBSBasicProperties::on_buttonBox_clicked(QAbstractButton *button)
 				obs_data_create_from_json(data.c_str());
 			obs_source_t *source = obs_get_source_by_name(
 				obs_data_get_string(settings, "undo_sname"));
-			obs_source_update(source, settings);
+			obs_source_reset_settings(source, settings);
 
 			obs_source_update_properties(source);