diff --git a/plugins/obs-outputs/rtmp-stream.c b/plugins/obs-outputs/rtmp-stream.c index f658854dd..ba104f8ed 100644 --- a/plugins/obs-outputs/rtmp-stream.c +++ b/plugins/obs-outputs/rtmp-stream.c @@ -187,10 +187,8 @@ static void *rtmp_stream_actual_stop(void *data) struct rtmp_stream *stream = data; void *ret; - if (stream->active) { + if (stream->active) pthread_join(stream->send_thread, &ret); - RTMP_Close(&stream->rtmp); - } os_event_reset(stream->stop_event); @@ -384,6 +382,8 @@ static void *send_thread(void *data) info("User stopped the stream"); } + RTMP_Close(&stream->rtmp); + if (!stopping(stream)) { pthread_detach(stream->send_thread); obs_output_signal_stop(stream->output, OBS_OUTPUT_DISCONNECTED);