diff --git a/src/mqtt_client_wrapper.cpp b/src/mqtt_client_wrapper.cpp index 69bafb3..d4d303f 100644 --- a/src/mqtt_client_wrapper.cpp +++ b/src/mqtt_client_wrapper.cpp @@ -104,18 +104,13 @@ static void on_mqtt_message_received(const std::string &topic, const std::string if (status == 0) { g_streaming = true; - // 启动推流:挂载本地配置中 enabled 的摄像头 + for (const auto &cam : g_app_config.cameras) { if (!cam.enabled) continue; - if (RTSPManager::is_streaming(cam.name)) - { - RTSPManager::unmount_camera(cam); - LOG_WARN("[MQTT] Start-before-unmount: " + cam.name); - } - + // 不再提前卸载 RTSPManager::mount_camera(cam); LOG_INFO("[MQTT] Started streaming: " + cam.name); }