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
This commit is contained in:
Fummo 2023-11-19 06:35:18 +00:00 committed by GitHub
parent 48ca0521cf
commit 88f7f46497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -577,8 +577,8 @@ void installWebHook() {
}); });
NoticeCenter::Instance().addListener(&web_hook_tag, Broadcast::kBroadcastStreamNoneReader, [](BroadcastStreamNoneReaderArgs) { NoticeCenter::Instance().addListener(&web_hook_tag, Broadcast::kBroadcastStreamNoneReader, [](BroadcastStreamNoneReaderArgs) {
if (!origin_urls.empty()) { if (!origin_urls.empty() && sender.getOriginType() == MediaOriginType::pull) {
// 边沿站无人观看时立即停止溯源 // 边沿站无人观看时如果是拉流的则立即停止溯源
sender.close(false); sender.close(false);
WarnL << "无人观看主动关闭流:" << sender.getOriginUrl(); WarnL << "无人观看主动关闭流:" << sender.getOriginUrl();
return; return;