Skip to content

Commit

Permalink
[core] Fixed the issue with RTT in case of bidirectional transmission…
Browse files Browse the repository at this point in the history
… introduced when adding atomic types
  • Loading branch information
mbakholdina authored and maxsharabayko committed Dec 13, 2021
1 parent ae787bf commit 26678fe
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8452,16 +8452,14 @@ void srt::CUDT::processCtrlAck(const CPacket &ctrlpkt, const steady_clock::time_
// TODO: The case of bidirectional transmission requires further
// improvements and testing. Double smoothing is applied here to be
// consistent with the previous behavior.

int crtt = m_iSRTT.load(), crttvar = m_iRTTVar.load();

if (crtt != INITIAL_RTT && rttvar != INITIAL_RTTVAR)
if (rtt != INITIAL_RTT && rttvar != INITIAL_RTTVAR)
{
crttvar = avg_iir<4>(crttvar, abs(crtt - rtt));
crtt = avg_iir<8>(crtt, rtt);
int iSRTT = m_iSRTT.load(), iRTTVar = m_iRTTVar.load();
iRTTVar = avg_iir<4>(iRTTVar, abs(rtt - iSRTT));
iSRTT = avg_iir<8>(iSRTT, rtt);
m_iSRTT = iSRTT;
m_iRTTVar = iRTTVar;
}
m_iSRTT = crtt;
m_iRTTVar = crttvar;
}
else // Transmission is unidirectional.
{
Expand Down

0 comments on commit 26678fe

Please sign in to comment.