From a93c57eb59c9e1960fa306951ac77201e75b4238 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 7 Nov 2020 17:46:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dehome=E6=8E=A8=E6=B5=81?= =?UTF-8?q?=E7=9B=B8=E5=85=B3bug:=20#549?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtp/RtpSplitter.cpp | 3 ++- src/Rtp/RtpSplitter.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Rtp/RtpSplitter.cpp b/src/Rtp/RtpSplitter.cpp index 0bb76d59..6cc8900b 100644 --- a/src/Rtp/RtpSplitter.cpp +++ b/src/Rtp/RtpSplitter.cpp @@ -24,7 +24,7 @@ int64_t RtpSplitter::onRecvHeader(const char *data,uint64_t len){ data += _offset; len -= _offset; - if (_offset == kEHOME_OFFSET + 4 && len > 12 && data[12] == '\r') { + if (_is_ehome && len > 12 && data[12] == '\r') { //这是ehome,移除第12个字节 memmove((char *) data + 1, data, 12); data += 1; @@ -55,6 +55,7 @@ const char *RtpSplitter::onSearchPacketTail(const char *data, uint64_t len) { } //忽略ehome私有头后是rtsp样式的rtp,多4个字节, _offset = kEHOME_OFFSET + 4; + _is_ehome = true; //忽略ehome私有头 return onSearchPacketTail_l(data + kEHOME_OFFSET + 2, len - kEHOME_OFFSET - 2); } diff --git a/src/Rtp/RtpSplitter.h b/src/Rtp/RtpSplitter.h index 9f895c21..68e10cbc 100644 --- a/src/Rtp/RtpSplitter.h +++ b/src/Rtp/RtpSplitter.h @@ -36,6 +36,7 @@ protected: private: int _offset = 0; + bool _is_ehome = false; }; }//namespace mediakit