From 7029304b32ea30a1e5b54427778324263f410add Mon Sep 17 00:00:00 2001 From: Roman Sivriver Date: Fri, 11 Dec 2020 10:10:08 -0500 Subject: [PATCH] ftl-stream: Fix reconnect loop on FTL ingest disconnect When connection to FTL ingest is lost, ftl_event() calls obs_output_signal_stop() to trigger a reconnect. However, during the reconnect delay, send_thread is still waiting on send_sem semaphore. After the delay, ftl_stream_start() is called, which in turn resets the semaphore and creates a new send_thread. Old send_thread now exits the loop and triggers another reconnect and the whole process repeats again. The fix resets the semaphore in ftl_event() so the old send_thread exits immediately. --- plugins/obs-outputs/ftl-stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/obs-outputs/ftl-stream.c b/plugins/obs-outputs/ftl-stream.c index 25ccb4519..2ae7042f5 100644 --- a/plugins/obs-outputs/ftl-stream.c +++ b/plugins/obs-outputs/ftl-stream.c @@ -886,6 +886,7 @@ static enum ret_type ftl_event(struct ftl_stream *stream, //tell OBS and it will trigger a reconnection blog(LOG_WARNING, "Reconnecting to Ingest"); obs_output_signal_stop(stream->output, OBS_OUTPUT_DISCONNECTED); + reset_semaphore(stream); return RET_EXIT; }