修复rtsp播放器在处理rtp包时,清空状态导致的bug

This commit is contained in:
xiongziliang
2021-01-17 10:25:00 +08:00
parent 2dd87c8b59
commit c445ad2cdf
3 changed files with 12 additions and 5 deletions

View File

@@ -30,19 +30,23 @@ enum PlayType {
};
RtspPlayer::RtspPlayer(const EventPoller::Ptr &poller) : TcpClient(poller){
RtpReceiver::setPoolSize(64);
}
RtspPlayer::~RtspPlayer(void) {
DebugL << endl;
}
void RtspPlayer::teardown(){
void RtspPlayer::sendTeardown(){
if (alive()) {
if (!_content_base.empty()) {
sendRtspRequest("TEARDOWN", _content_base);
}
shutdown(SockException(Err_shutdown, "teardown"));
}
}
void RtspPlayer::teardown(){
sendTeardown();
_md5_nonce.clear();
_realm.clear();
_sdp_track.clear();
@@ -792,7 +796,7 @@ void RtspPlayer::onPlayResult_l(const SockException &ex , bool handshake_done) {
//创建rtp数据接收超时检测定时器
_rtp_check_timer = std::make_shared<Timer>(timeoutMS / 2000.0, lam, getPoller());
} else {
teardown();
sendTeardown();
}
}