From c40aa6d031a48e3dacca5bae46a6b36737cbdeec Mon Sep 17 00:00:00 2001 From: zhengwang Date: Mon, 3 Jun 2024 16:41:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E6=BA=90=E6=9E=90?= =?UTF-8?q?=E6=9E=84=E6=97=B6=E7=BB=84=E6=92=AD=E5=AF=B9=E8=B1=A1=E5=81=B6?= =?UTF-8?q?=E7=8E=B0=E6=9E=90=E6=9E=84=E4=B8=8D=E4=BA=86=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/RtpMultiCaster.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Rtsp/RtpMultiCaster.cpp b/src/Rtsp/RtpMultiCaster.cpp index fefc0f84..032aacc8 100644 --- a/src/Rtsp/RtpMultiCaster.cpp +++ b/src/Rtsp/RtpMultiCaster.cpp @@ -144,7 +144,16 @@ RtpMultiCaster::RtpMultiCaster(SocketHelper &helper, const string &local_ip, con }); }); + string strKey = StrPrinter << local_ip << " " << vhost << " " << app << " " << stream << endl; _rtp_reader->setDetachCB([this]() { + { + lock_guard lck(g_mtx); + auto it = g_multi_caster_map.find(strKey); + if (it != g_multi_caster_map.end()) { + g_multi_caster_map.erase(it); + } + } + unordered_map _detach_map_copy; { lock_guard lck(_mtx);