diff --git a/src/rtsp_manager.cpp b/src/rtsp_manager.cpp index 8f24a00..9e276b3 100644 --- a/src/rtsp_manager.cpp +++ b/src/rtsp_manager.cpp @@ -325,7 +325,11 @@ bool RTSPManager::is_any_streaming() void RTSPManager::stop() { - if (loop) + if (!loop) return; + + if (server) gst_rtsp_server_set_backlog(server, 0); // optional + + if (main_context) { g_main_context_invoke( main_context, @@ -336,4 +340,6 @@ void RTSPManager::stop() }, loop); } + + g_main_loop_quit(loop); }