From e249a03dc2b29f5c5cdde1f4f1ae75b9fb12cbbf Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 27 Oct 2021 13:40:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B0=83=E7=94=A8stopSendRtp?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=97=A0=E6=B3=95=E8=A7=A6=E5=8F=91=E6=97=A0?= =?UTF-8?q?=E4=BA=BA=E8=A7=82=E7=9C=8B=E4=BA=8B=E4=BB=B6=E7=9A=84bug?= =?UTF-8?q?=EF=BC=9A#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MultiMediaSourceMuxer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Common/MultiMediaSourceMuxer.cpp b/src/Common/MultiMediaSourceMuxer.cpp index 82a3999b..f60829da 100644 --- a/src/Common/MultiMediaSourceMuxer.cpp +++ b/src/Common/MultiMediaSourceMuxer.cpp @@ -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 token; if (&sender != MediaSource::NullMediaSource) { - onceToken token(nullptr, [&]() { + token.reset(new onceToken(nullptr, [&]() { //关闭rtp推流,可能触发无人观看事件 MediaSourceEventInterceptor::onReaderChanged(sender, totalReaderCount()); - }); + })); } if (ssrc.empty()) { //关闭全部