diff --git a/src/rtsp_manager.cpp b/src/rtsp_manager.cpp index 5e002da..ba86ed0 100644 --- a/src/rtsp_manager.cpp +++ b/src/rtsp_manager.cpp @@ -58,6 +58,11 @@ void RTSPManager::start(const std::vector &cameras) void RTSPManager::stop() { + if (loop) + { + g_main_loop_quit(loop); // 退出 GMainLoop + } + if (server) { g_object_unref(server); @@ -68,5 +73,6 @@ void RTSPManager::stop() g_main_loop_unref(loop); loop = nullptr; } + LOG_INFO("[RTSP] Server stopped."); }