-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix old buffer items cleanup in RTC::RateCalculator
#830
Fix old buffer items cleanup in RTC::RateCalculator
#830
Conversation
`RemoveOldData` is supposed to remove old buffer items
It fixes the case when `nowMs` equals `oldestItemStartTime` + `windowSizeMs`.
@rtctt Do you have a chance to verify the fix in the setup you've described in #819? |
Thanks. Could you please tell the differences between this PR and the previous one? Specifically to see how this solves the infinite loop. |
The commit adds a unit test and fixes the case @rtctt described in the previous PR. Basically, when we receive a packet with timestamp greater or equal than current I believe the case isn't properly handled in the current version either; even though it doesn't gets into an infinite loop, it calculates bitrate wrong. |
@dsdolzhenko I have checked this PR and there is no problem. I understand what you mean, reset the buffer instead of removing the last item to avoid getting stuck in a loop. 👍 |
What's wrong? |
I suppose, in the edge case, when the next packet timestamp is exactly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks @dsdolzhenko |
Thanks a lot, merged and released in 3.9.17. |
This is the fix for the issue described in #818 and the infinite loop found in #819 (the first attempt to fix #818)