From 209d47cf3b450014df8bd85eeef26780bbc85a58 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 7 Sep 2021 16:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwebrtc=20simulcast=E6=8E=A8?= =?UTF-8?q?=E6=B5=81=E5=B4=A9=E6=BA=83=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rdpart/ZLToolKit | 2 +- webrtc/WebRtcTransport.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index 36d1122f..a827f0bd 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit 36d1122f42ab6b92d0ca8f57df0462acc632efc7 +Subproject commit a827f0bdcb4221c19ab1a243ebd1f01fa7dc50f2 diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 6769086b..dd6b40c5 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -436,8 +436,11 @@ void WebRtcTransportImp::onStartWebRTC() { if (m_offer->type != TrackApplication) { //记录rtp ext类型与id的关系,方便接收或发送rtp时修改rtp ext id track->rtp_ext_ctx = std::make_shared(*m_offer); - track->rtp_ext_ctx->setOnGetRtp([this, &track](uint8_t pt, uint32_t ssrc, const string &rid) { + weak_ptr weak_track = track; + track->rtp_ext_ctx->setOnGetRtp([this, weak_track](uint8_t pt, uint32_t ssrc, const string &rid) { //ssrc --> MediaTrack + auto track = weak_track.lock(); + assert(track); _ssrc_to_track[ssrc] = track; InfoL << "get rtp, pt:" << (int) pt << ", ssrc:" << ssrc << ", rid:" << rid; });