From 9c639335ea4d7e6d5c05e2efb85c44efa3dd7721 Mon Sep 17 00:00:00 2001 From: cxh Date: Wed, 7 Jan 2026 17:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E7=9A=84?= =?UTF-8?q?=E6=B5=81=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mqtt_client_wrapper.cpp | 7 +++++-- src/rtmp_manager.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mqtt_client_wrapper.cpp b/src/mqtt_client_wrapper.cpp index 0aed6c6..4948ecd 100644 --- a/src/mqtt_client_wrapper.cpp +++ b/src/mqtt_client_wrapper.cpp @@ -113,8 +113,11 @@ static void handle_video_down_request(const nlohmann::json& req) int loc = 0; for (const auto& ch : channels_info) { - resp["data"].push_back({{"loc", loc}, {"url", ch.url}}); - loc++; + if (ch.running) + { + resp["data"].push_back({{"loc", loc}, {"url", ch.url}}); + loc++; + } } mqtt_client->publish(g_app_config.mqtt.topics.video_down, resp.dump(-1), 1); diff --git a/src/rtmp_manager.cpp b/src/rtmp_manager.cpp index a75bfd5..751a450 100644 --- a/src/rtmp_manager.cpp +++ b/src/rtmp_manager.cpp @@ -306,7 +306,7 @@ bool RTMPManager::is_streaming(const std::string& cam_name) std::string RTMPManager::get_stream_url(const std::string& cam_name) { std::string ip = get_ip_address("enP2p33s0"); - if (ip.empty()) ip = "127.0.0.1"; + if (ip.empty()) ip = "192.168.4.194"; return "http://" + ip + ":11985/rtc/v1/whep/?app=camera&stream=" + cam_name + "_main&vhost=live"; }