From 61b29efe94396bbc6637a242b1820a709e13d9ce Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 27 Dec 2020 21:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=BB=A3=E7=A0=81=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 6 ++---- src/Rtp/RtpProcess.cpp | 4 +++- src/Rtp/RtpServer.h | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 53afc5bc..9bf6eddc 100644 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -881,8 +881,7 @@ void installWebApi() { //只是暂停流的检查,流媒体服务器做为流负载服务,收流就转发,RTSP/RTMP有自己暂停协议 lock_guard lck(s_rtpServerMapMtx); auto it = s_rtpServerMap.find(allArgs["stream_id"]); - if (it == s_rtpServerMap.end()) - { + if (it == s_rtpServerMap.end()) { val["hit"] = 0; return; } @@ -897,8 +896,7 @@ void installWebApi() { lock_guard lck(s_rtpServerMapMtx); auto it = s_rtpServerMap.find(allArgs["stream_id"]); - if (it == s_rtpServerMap.end()) - { + if (it == s_rtpServerMap.end()) { val["hit"] = 0; return; } diff --git a/src/Rtp/RtpProcess.cpp b/src/Rtp/RtpProcess.cpp index 34bd9ab3..942feec9 100644 --- a/src/Rtp/RtpProcess.cpp +++ b/src/Rtp/RtpProcess.cpp @@ -135,8 +135,10 @@ void RtpProcess::addTrackCompleted() { } bool RtpProcess::alive() { - if(_stop_rtp_check.load()) + if (_stop_rtp_check.load()) { return true; + } + GET_CONFIG(int, timeoutSec, RtpProxy::kTimeoutSec) if (_last_frame_time.elapsedTime() / 1000 < timeoutSec) { return true; diff --git a/src/Rtp/RtpServer.h b/src/Rtp/RtpServer.h index ad279413..cc3d5aaa 100644 --- a/src/Rtp/RtpServer.h +++ b/src/Rtp/RtpServer.h @@ -56,10 +56,12 @@ public: * 设置RtpProcess onDetach事件回调 */ void setOnDetach(const function &cb); + /** * 暂停Rtp服务的RTP流检测 */ void pauseRtpCheck(); + /** * 恢复Rtp服务的RTP流检测 */