Quellcode durchsuchen

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 vor 4 Jahren
Ursprung
Commit
b685d1bf88
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  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);