1
This commit is contained in:
parent
6a601227d6
commit
09fdc0a875
@ -295,12 +295,19 @@ void RTMPManager::stream_loop(Camera cam, StreamContext* ctx)
|
||||
// ========== 启停与状态 ==========
|
||||
void RTMPManager::start_all()
|
||||
{
|
||||
LOG_INFO("[RTMP] Starting all record streams...");
|
||||
LOG_INFO("[RTMP] Starting enabled record streams...");
|
||||
std::lock_guard<std::mutex> lock(streams_mutex);
|
||||
|
||||
int delay_ms = 0;
|
||||
for (auto& cam : g_app_config.cameras)
|
||||
for (const auto& cam : g_app_config.cameras)
|
||||
{
|
||||
// 🔴 核心修正:跳过未启用摄像头
|
||||
if (!cam.enabled)
|
||||
{
|
||||
LOG_INFO("[RTMP] Skip disabled camera: " + cam.name);
|
||||
continue;
|
||||
}
|
||||
|
||||
auto key = make_key(cam.name);
|
||||
if (streams.find(key) != streams.end())
|
||||
{
|
||||
@ -319,7 +326,7 @@ void RTMPManager::start_all()
|
||||
});
|
||||
|
||||
streams.emplace(key, std::move(ctx));
|
||||
delay_ms += 200; // 每路错开 200ms
|
||||
delay_ms += 200;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user