代码优化

This commit is contained in:
xiongziliang 2020-05-28 12:44:25 +08:00
parent 0548256c30
commit ebc1ee2c6e
2 changed files with 1 additions and 2 deletions

View File

@ -148,7 +148,6 @@ static inline void addHttpListener(){
NoticeCenter::Instance().addListener(nullptr, Broadcast::kBroadcastHttpRequest, [](BroadcastHttpRequestArgs) { NoticeCenter::Instance().addListener(nullptr, Broadcast::kBroadcastHttpRequest, [](BroadcastHttpRequestArgs) {
auto it = s_map_api.find(parser.Url()); auto it = s_map_api.find(parser.Url());
if (it == s_map_api.end()) { if (it == s_map_api.end()) {
consumed = false;
return; return;
} }
//该api已被消费 //该api已被消费

View File

@ -58,7 +58,7 @@ static bool loadFile(const char *path){
RtpSelector::Instance().inputRtp(nullptr,rtp,len, &addr,&timeStamp); RtpSelector::Instance().inputRtp(nullptr,rtp,len, &addr,&timeStamp);
if(timeStamp_last){ if(timeStamp_last){
auto diff = timeStamp - timeStamp_last; auto diff = timeStamp - timeStamp_last;
if(diff > 0){ if(diff > 0 && diff < 500){
usleep(diff * 1000); usleep(diff * 1000);
} }
} }