From 55c2b08c57e8f2e22729f22abc38bfa0a14cdd08 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 8 Jun 2021 20:51:54 +0800 Subject: [PATCH] =?UTF-8?q?rtsp=E6=92=AD=E6=94=BE=E5=99=A8=E5=9C=A8udp?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=BB=B6=E9=95=BF4=E5=80=8D(=E9=98=B2=E6=AD=A2vlc=E8=B6=85?= =?UTF-8?q?=E6=97=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/RtspSession.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index c14a7978..1e12adee 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -99,11 +99,16 @@ void RtspSession::onManager() { } } - if ((_rtp_type == Rtsp::RTP_UDP || _push_src ) && _alive_ticker.elapsedTime() > keep_alive_sec * 1000 && _enable_send_rtp) { - //如果是推流端或者rtp over udp类型的播放端,那么就做超时检测 - shutdown(SockException(Err_timeout,"rtp over udp session timeouted")); + if (_push_src && _alive_ticker.elapsedTime() > keep_alive_sec * 1000) { + //推流超时 + shutdown(SockException(Err_timeout, "pusher session timeouted")); return; } + + if (!_push_src && _rtp_type == Rtsp::RTP_UDP && _enable_send_rtp && _alive_ticker.elapsedTime() > keep_alive_sec * 4000) { + //rtp over udp播放器超时 + shutdown(SockException(Err_timeout, "rtp over udp player timeouted")); + } } void RtspSession::onRecv(const Buffer::Ptr &buf) {