diff --git a/src/stream.cpp b/src/stream.cpp index e9a3bf9d..da3bb411 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -1823,13 +1823,13 @@ namespace stream { audio_packets.reset(); BOOST_LOG(debug) << "Waiting for main listening thread to end..."sv; - ctx.recv_thread.join(); + if (ctx.recv_thread.joinable()) ctx.recv_thread.join(); BOOST_LOG(debug) << "Waiting for main video thread to end..."sv; - ctx.video_thread.join(); + if (ctx.video_thread.joinable()) ctx.video_thread.join(); BOOST_LOG(debug) << "Waiting for main audio thread to end..."sv; - ctx.audio_thread.join(); + if (ctx.audio_thread.joinable()) ctx.audio_thread.join(); BOOST_LOG(debug) << "Waiting for main control thread to end..."sv; - ctx.control_thread.join(); + if (ctx.control_thread.joinable()) ctx.control_thread.join(); BOOST_LOG(debug) << "All broadcasting threads ended"sv; broadcast_shutdown_event->reset();