From f05f0592e07a8434d438e66e8eac4697c3561223 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 18 Nov 2015 10:30:26 -0800 Subject: [PATCH] obs-outputs: Don't allow new data if disconnected --- plugins/obs-outputs/rtmp-stream.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/obs-outputs/rtmp-stream.c b/plugins/obs-outputs/rtmp-stream.c index 0c3f4a8a3..69d214298 100644 --- a/plugins/obs-outputs/rtmp-stream.c +++ b/plugins/obs-outputs/rtmp-stream.c @@ -833,9 +833,11 @@ static void rtmp_stream_data(void *data, struct encoder_packet *packet) pthread_mutex_lock(&stream->packets_mutex); - added_packet = (packet->type == OBS_ENCODER_VIDEO) ? - add_video_packet(stream, &new_packet) : - add_packet(stream, &new_packet); + if (!disconnected(stream)) { + added_packet = (packet->type == OBS_ENCODER_VIDEO) ? + add_video_packet(stream, &new_packet) : + add_packet(stream, &new_packet); + } pthread_mutex_unlock(&stream->packets_mutex);