Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worker: Fix NACK timer and avoid negative RTT #1082

Merged
merged 2 commits into from
May 18, 2023

Conversation

ibc
Copy link
Member

@ibc ibc commented May 18, 2023

Based on PR #1076 of @o-u-p

Details

  • Stop NACK timer when NACK list is empty as explained in fix: nack timer not work as expected #1076 (comment).
  • Avoid RTT becoming negative in RtpStreamSend and RtpStreamRecv. If so, assign it with 0.0f.
  • And if 0.0f, use DefaultRtt (100 ms) in NackGenerator.
  • Remove useless RtpStream::hasRtt and check RtpStream::rtt > 0.0f instead.
  • Add some brackets in condition blocks.

Based on PR #1076 of @o-u-p

### Details

- Stop NACK timer when NACK list is empty as explained in #1076 (comment).
- Avoid RTT becoming negative in `RtpStreamSend` and `RtpStreamRecv`. If so, assign it with 0.0f.
- And if 0.0f, use `DefaultRtt` (100 ms) in `NackGenerator`.
- Remove useless `RtpStream::hasRtt` and check `RtpStream::rtt > 0.0f` instead.
- Add some brackets in condition blocks.
if (
filter == NackFilter::TIME &&
(nackInfo.sentAtMs == 0 ||
nowMs - nackInfo.sentAtMs >= (this->rtt > 0u ? this->rtt : DefaultRtt)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nowMs - nackInfo.sentAtMs >= (this->rtt > 0u ? this->rtt : DefaultRtt)))
nowMs - nackInfo.sentAtMs >= (this->rtt > 0.0f ? this->rtt : DefaultRtt)))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. this->rtt in NackGenerator is uint32_t.

Copy link
Member

@jmillan jmillan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ibc ibc merged commit 75c11ee into v3 May 18, 2023
34 checks passed
@ibc ibc deleted the fix-nack-timer-and-avoid-negative-rtt branch May 18, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants