修复webrtc模块循环引用导致的内存泄露问题:#1024

This commit is contained in:
ziyue 2021-09-03 11:46:36 +08:00
parent 08e74256da
commit 41f8d7fbd2

View File

@ -436,7 +436,7 @@ void WebRtcTransportImp::onStartWebRTC() {
if (m_offer->type != TrackApplication) { if (m_offer->type != TrackApplication) {
//记录rtp ext类型与id的关系方便接收或发送rtp时修改rtp ext id //记录rtp ext类型与id的关系方便接收或发送rtp时修改rtp ext id
track->rtp_ext_ctx = std::make_shared<RtpExtContext>(*m_offer); track->rtp_ext_ctx = std::make_shared<RtpExtContext>(*m_offer);
track->rtp_ext_ctx->setOnGetRtp([this, track](uint8_t pt, uint32_t ssrc, const string &rid) { track->rtp_ext_ctx->setOnGetRtp([this, &track](uint8_t pt, uint32_t ssrc, const string &rid) {
//ssrc --> MediaTrack //ssrc --> MediaTrack
_ssrc_to_track[ssrc] = track; _ssrc_to_track[ssrc] = track;
InfoL << "get rtp, pt:" << (int) pt << ", ssrc:" << ssrc << ", rid:" << rid; InfoL << "get rtp, pt:" << (int) pt << ", ssrc:" << ssrc << ", rid:" << rid;