修复调用stopSendRtp接口无法触发无人观看事件的bug:#1189

This commit is contained in:
ziyue 2021-10-27 13:40:59 +08:00
parent 350a0e3f81
commit e249a03dc2

View File

@ -219,11 +219,12 @@ void MultiMediaSourceMuxer::startSendRtp(MediaSource &, const string &dst_url, u
bool MultiMediaSourceMuxer::stopSendRtp(MediaSource &sender, const string &ssrc) {
#if defined(ENABLE_RTPPROXY)
std::unique_ptr<onceToken> token;
if (&sender != MediaSource::NullMediaSource) {
onceToken token(nullptr, [&]() {
token.reset(new onceToken(nullptr, [&]() {
//关闭rtp推流可能触发无人观看事件
MediaSourceEventInterceptor::onReaderChanged(sender, totalReaderCount());
});
}));
}
if (ssrc.empty()) {
//关闭全部