From 8db9f86a0a930af44ab8f6868d96740eb1fd9088 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 31 Jan 2021 19:56:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0RtcpContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/RtspPlayer.cpp | 1 + src/Rtsp/RtspPusher.cpp | 1 + src/Rtsp/RtspSession.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Rtsp/RtspPlayer.cpp b/src/Rtsp/RtspPlayer.cpp index df930a52..9ee8adb0 100644 --- a/src/Rtsp/RtspPlayer.cpp +++ b/src/Rtsp/RtspPlayer.cpp @@ -203,6 +203,7 @@ void RtspPlayer::handleResDESCRIBE(const Parser& parser) { if (!onCheckSDP(sdpParser.toString())) { throw std::runtime_error("onCheckSDP faied"); } + _rtcp_context.clear(); for (auto &track : _sdp_track) { _rtcp_context.emplace_back(std::make_shared(track->_samplerate, true)); } diff --git a/src/Rtsp/RtspPusher.cpp b/src/Rtsp/RtspPusher.cpp index 4accfcca..4dde91a3 100644 --- a/src/Rtsp/RtspPusher.cpp +++ b/src/Rtsp/RtspPusher.cpp @@ -176,6 +176,7 @@ void RtspPusher::sendAnnounce() { if (_track_vec.empty()) { throw std::runtime_error("无有效的Sdp Track"); } + _rtcp_context.clear(); for (auto &track : _track_vec) { _rtcp_context.emplace_back(std::make_shared(track->_samplerate, false)); } diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index 264e7d1d..781732d1 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -406,6 +406,7 @@ void RtspSession::onAuthSuccess() { strongSelf->shutdown(SockException(Err_shutdown,"can not find any available track in sdp")); return; } + strongSelf->_rtcp_context.clear(); for (auto &track : strongSelf->_sdp_track) { strongSelf->_rtcp_context.emplace_back(std::make_shared(track->_samplerate, false)); }