GB28181推流,无人观看时不解复用数据

This commit is contained in:
xiongziliang 2020-11-14 23:11:28 +08:00
parent 6c8f1c9403
commit 3d8f015f5d

View File

@ -101,6 +101,14 @@ bool RtpProcess::inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data
if (!_process) { if (!_process) {
_process = std::make_shared<GB28181Process>(_media_info, this); _process = std::make_shared<GB28181Process>(_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; bool ret = _process ? _process->inputRtp(is_udp, data, len) : false;
if (dts_out) { if (dts_out) {
*dts_out = _dts; *dts_out = _dts;