mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
限定nack rtt时间有效值范围
This commit is contained in:
parent
1cc0f51c07
commit
c301ecd207
@ -205,10 +205,8 @@ void NackContext::clearNackStatus(uint16_t seq) {
|
||||
auto rtt = getCurrentMillisecond() - it->second.first_stamp;
|
||||
_nack_send_status.erase(it);
|
||||
|
||||
if (rtt >= 0) {
|
||||
// rtt不能小于0
|
||||
_rtt = rtt;
|
||||
}
|
||||
// 限定rtt在合理有效范围内
|
||||
_rtt = max<int>(10, min<int>(rtt, kNackMaxMS / kNackMaxCount));
|
||||
}
|
||||
|
||||
void NackContext::recordNack(const FCI_NACK &nack) {
|
||||
@ -280,7 +278,7 @@ uint64_t NackContext::reSendNack() {
|
||||
}
|
||||
|
||||
// 没有任何包需要重传时返回0,否则返回下次重传间隔(不得低于5ms)
|
||||
return _nack_send_status.empty() ? 0 : max(_rtt, 5);
|
||||
return _nack_send_status.empty() ? 0 : _rtt;
|
||||
}
|
||||
|
||||
} // namespace mediakit
|
||||
|
Loading…
Reference in New Issue
Block a user