From 8d122625c58d158e6e5d3567c4c7cf043d1a50e5 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Tue, 9 Feb 2021 14:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D28181=E7=9B=B8=E5=85=B3bug?= =?UTF-8?q?=EF=BC=9A#731?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtp/GB28181Process.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Rtp/GB28181Process.cpp b/src/Rtp/GB28181Process.cpp index 93e81a0a..f8bd6b90 100644 --- a/src/Rtp/GB28181Process.cpp +++ b/src/Rtp/GB28181Process.cpp @@ -77,10 +77,12 @@ void GB28181Process::onRtpSorted(RtpPacket::Ptr rtp, int) { const char *GB28181Process::onSearchPacketTail(const char *packet,size_t bytes){ try { auto ret = _decoder->input((uint8_t *) packet, bytes); - if (ret > 0) { + if (ret >= 0) { + //解析成功全部或部分 return packet + ret; } - return nullptr; + //解析失败,丢弃所有数据 + return packet + bytes; } catch (std::exception &ex) { InfoL << "解析ps或ts异常: bytes=" << bytes << " ,exception=" << ex.what()