优化代码

空构造和析构函数替换为缺省
去除多余分号
This commit is contained in:
xiongziliang
2023-04-22 21:59:26 +08:00
parent e8a425945d
commit 7a95c87a29
21 changed files with 50 additions and 57 deletions

View File

@@ -13,12 +13,8 @@
#include "RtpSplitter.h"
namespace mediakit{
static const char kEHOME_MAGIC[] = "\x01\x00\x01\x00";
static const int kEHOME_OFFSET = 256;
RtpSplitter::RtpSplitter() {}
RtpSplitter::~RtpSplitter() {}
ssize_t RtpSplitter::onRecvHeader(const char *data,size_t len){
//忽略偏移量
data += _offset;
@@ -38,11 +34,10 @@ static bool isEhome(const char *data, size_t len){
if (len < 4) {
return false;
}
if((data[0] == 0x01) && (data[1] == 0x00) && (data[2] >=0x01)){
if ((data[0] == 0x01) && (data[1] == 0x00) && (data[2] >= 0x01)) {
return true;
}
return false;
//return memcmp(data, kEHOME_MAGIC, sizeof(kEHOME_MAGIC) - 1) == 0;
}
const char *RtpSplitter::onSearchPacketTail(const char *data, size_t len) {