diff --git a/plugins/obs-outputs/rtmp-stream.c b/plugins/obs-outputs/rtmp-stream.c index 4df12a33d..34f3c3489 100644 --- a/plugins/obs-outputs/rtmp-stream.c +++ b/plugins/obs-outputs/rtmp-stream.c @@ -708,6 +708,15 @@ static void *send_thread(void *data) } set_output_error(stream); + + if (silently_reconnecting(stream)) { + /* manually close the socket to prevent librtmp from sending + * unpublish / deletestream messages when we call RTMP_Close, + * since we want to re-use this stream when we reconnect */ + RTMPSockBuf_Close(&stream->rtmp.m_sb); + stream->rtmp.m_sb.sb_socket = -1; + } + RTMP_Close(&stream->rtmp); /* reset bitrate on stop */