From b98959836f7fd7335d13ebfd90319116025aef93 Mon Sep 17 00:00:00 2001 From: scaledteam <43995399+scaledteam@users.noreply.github.com> Date: Fri, 20 Aug 2021 00:23:53 +0500 Subject: [PATCH] fix when changed source --- image-reaction.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/image-reaction.c b/image-reaction.c index 87e045e..b211fd5 100644 --- a/image-reaction.c +++ b/image-reaction.c @@ -146,10 +146,13 @@ static void image_reaction_source_update(void *data, obs_data_t *settings) if (old_name == NULL || (new_name != "" && strcmp(new_name, old_name) != 0)) { info("name changed"); + obs_source_t *capture = obs_get_source_by_name(new_name); //obs_weak_source_t *weak_capture = capture ? obs_source_get_weak_source(capture) : NULL; if (capture) { + obs_source_remove_audio_capture_callback(context->audio_source, audio_capture, context); + context->audio_source = capture; info("Added audio capture to '%s'", obs_source_get_name(capture));