From 88f7f4649775e186ded83fc2c786d197e02530f4 Mon Sep 17 00:00:00 2001 From: Fummo Date: Sun, 19 Nov 2023 06:35:18 +0000 Subject: [PATCH] Bugfix: Only close edge streams with no viewers (#2994) Bugfix to only close streams with no viewers if they originate from an edge server rather than all streams. Fixes https://github.com/ZLMediaKit/ZLMediaKit/issues/2981 --- server/WebHook.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/WebHook.cpp b/server/WebHook.cpp index 43329927..409d11f4 100755 --- a/server/WebHook.cpp +++ b/server/WebHook.cpp @@ -577,8 +577,8 @@ void installWebHook() { }); NoticeCenter::Instance().addListener(&web_hook_tag, Broadcast::kBroadcastStreamNoneReader, [](BroadcastStreamNoneReaderArgs) { - if (!origin_urls.empty()) { - // 边沿站无人观看时立即停止溯源 + if (!origin_urls.empty() && sender.getOriginType() == MediaOriginType::pull) { + // 边沿站无人观看时如果是拉流的则立即停止溯源 sender.close(false); WarnL << "无人观看主动关闭流:" << sender.getOriginUrl(); return;