Skip to content

Commit

Permalink
[core] Source rate estimate: ignore old samples
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Mar 14, 2022
1 parent 589d36e commit fe5debb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions srtcore/buffer.cpp
Expand Up @@ -133,6 +133,11 @@ void CRateEstimator::updateInputRate(const time_point& time, int pkts, int bytes
m_tsInRateStartTime = time;
return;
}
else if (time < m_tsInRateStartTime)
{
// Old packets are being submitted for estimation, e.g. during the backup link activation.
return;
}

m_iInRatePktsCount += pkts;
m_iInRateBytesCount += bytes;
Expand Down

0 comments on commit fe5debb

Please sign in to comment.