修复ehome推流相关bug: #549

This commit is contained in:
xiongziliang 2020-11-07 17:46:37 +08:00
parent 57a11f19dd
commit a93c57eb59
2 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,7 @@ int64_t RtpSplitter::onRecvHeader(const char *data,uint64_t len){
data += _offset; data += _offset;
len -= _offset; len -= _offset;
if (_offset == kEHOME_OFFSET + 4 && len > 12 && data[12] == '\r') { if (_is_ehome && len > 12 && data[12] == '\r') {
//这是ehome,移除第12个字节 //这是ehome,移除第12个字节
memmove((char *) data + 1, data, 12); memmove((char *) data + 1, data, 12);
data += 1; data += 1;
@ -55,6 +55,7 @@ const char *RtpSplitter::onSearchPacketTail(const char *data, uint64_t len) {
} }
//忽略ehome私有头后是rtsp样式的rtp多4个字节 //忽略ehome私有头后是rtsp样式的rtp多4个字节
_offset = kEHOME_OFFSET + 4; _offset = kEHOME_OFFSET + 4;
_is_ehome = true;
//忽略ehome私有头 //忽略ehome私有头
return onSearchPacketTail_l(data + kEHOME_OFFSET + 2, len - kEHOME_OFFSET - 2); return onSearchPacketTail_l(data + kEHOME_OFFSET + 2, len - kEHOME_OFFSET - 2);
} }

View File

@ -36,6 +36,7 @@ protected:
private: private:
int _offset = 0; int _offset = 0;
bool _is_ehome = false;
}; };
}//namespace mediakit }//namespace mediakit