From 91b05d2965da86f02aff3ace17b73a618a94ad68 Mon Sep 17 00:00:00 2001 From: 4aiman Date: Wed, 20 Dec 2023 19:09:56 +0300 Subject: [PATCH] Fixed audio source update I broke earlier :/ --- source_synchronizer.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source_synchronizer.lua b/source_synchronizer.lua index 08e4f21..5d97216 100644 --- a/source_synchronizer.lua +++ b/source_synchronizer.lua @@ -53,16 +53,11 @@ function timer_callback() -- get settings of a slave source local slave_props = obs.obs_source_get_settings(slave_source) -- also read the slave props, no need to update anything if there's no need to update anything ;) - local slave_window = obs.obs_data_get_string(master_props, 'window') + local slave_window = obs.obs_data_get_string(slave_props, 'window') if slave_window ~= master_window then - -- now that we have both, create a NEW temporary data object (again, no other way from lua, except ffi since 2020) - local new_slave_props = obs.obs_data_create() -- copy/paste the window property from the master to the slave obs.obs_data_set_string(slave_props, 'window', master_window) - -- set the new temporary data object as properties for the slave source - obs.obs_data_set_obj(new_slave_props, "sourceSettings", slave_props) - -- the copied source won't update unless... obs.obs_source_update(slave_source, slave_props) --obs.obs_frontend_open_source_properties(slave_source_name)