From 913a66ded1b2b8df64407aafac07ee83917dee5f Mon Sep 17 00:00:00 2001 From: Mateusz Salski Date: Fri, 19 Jun 2020 15:03:52 +0200 Subject: [PATCH] #15 OBS hangs on executing action Load via websockets - execute TransitionToScene in new thread --- replay-source.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/replay-source.c b/replay-source.c index 994d5da..d721652 100644 --- a/replay-source.c +++ b/replay-source.c @@ -1786,6 +1786,13 @@ static void replay_trim_reset_hotkey(void *data, obs_hotkey_id id, } } +static void *replay_thread(void *data) +{ + struct replay_source *context = data; + replay_hotkey(context, 0, NULL, true); + return NULL; +} + static void replay_source_update(void *data, obs_data_t *settings) { struct replay_source *context = data; @@ -1793,7 +1800,8 @@ static void replay_source_update(void *data, obs_data_t *settings) obs_data_get_string(settings, SETTING_EXECUTE_ACTION); if (execute_action && strlen(execute_action)) { if (strcmp(execute_action, "Load") == 0) { - replay_hotkey(context, 0, NULL, true); + pthread_t thread; + pthread_create(&thread, NULL, replay_thread, context); } else if (strcmp(execute_action, "Next") == 0) { replay_next_hotkey(context, 0, NULL, true); } else if (strcmp(execute_action, "Previous") == 0) {