无人观看自动关闭流时才打印日志

This commit is contained in:
ziyue 2021-08-12 10:54:57 +08:00
parent 094f7553c9
commit e3d519dde6
2 changed files with 5 additions and 5 deletions

View File

@ -421,6 +421,11 @@ void installWebHook(){
return; return;
} }
strongSrc->close(false); strongSrc->close(false);
WarnL << "无人观看主动关闭流:"
<< strongSrc->getSchema() << "/"
<< strongSrc->getVhost() << "/"
<< strongSrc->getApp() << "/"
<< strongSrc->getId();
}); });
}); });

View File

@ -537,11 +537,6 @@ void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
if (!is_mp4_vod) { if (!is_mp4_vod) {
//直播时触发无人观看事件,让开发者自行选择是否关闭 //直播时触发无人观看事件,让开发者自行选择是否关闭
WarnL << "无人观看事件:"
<< strong_sender->getSchema() << "/"
<< strong_sender->getVhost() << "/"
<< strong_sender->getApp() << "/"
<< strong_sender->getId();
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastStreamNoneReader, *strong_sender); NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastStreamNoneReader, *strong_sender);
} else { } else {
//这个是mp4点播我们自动关闭 //这个是mp4点播我们自动关闭