From 3d8f015f5dbe34a475c6fe8c2dce86e86be3bc14 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 14 Nov 2020 23:11:28 +0800 Subject: [PATCH] =?UTF-8?q?GB28181=E6=8E=A8=E6=B5=81=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E4=BA=BA=E8=A7=82=E7=9C=8B=E6=97=B6=E4=B8=8D=E8=A7=A3=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtp/RtpProcess.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Rtp/RtpProcess.cpp b/src/Rtp/RtpProcess.cpp index 64a4b197..9769b71d 100644 --- a/src/Rtp/RtpProcess.cpp +++ b/src/Rtp/RtpProcess.cpp @@ -101,6 +101,14 @@ bool RtpProcess::inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data if (!_process) { _process = std::make_shared(_media_info, this); } + + GET_CONFIG(string, dump_dir, RtpProxy::kDumpDir); + if (!_muxer->isEnabled() && !dts_out && dump_dir.empty()) { + //无人访问、且不取时间戳、不导出调试文件时,我们可以直接丢弃数据 + _last_frame_time.resetTime(); + return false; + } + bool ret = _process ? _process->inputRtp(is_udp, data, len) : false; if (dts_out) { *dts_out = _dts;