Fixed audio source update I broke earlier :/

This commit is contained in:
4aiman 2023-12-20 19:09:56 +03:00 • committed by GitHub
commit 91b05d2965
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)