-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix old buffer items cleanup in RTC::RateCalculator
#819
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
#819
Conversation
`RemoveOldData` is supposed to remove old buffer items
It fixes the case when `nowMs` equals `oldestItemStartTime` + `windowSizeMs`.
|
@jmillan ? |
|
Something wrong in this PR, will stuck in an infinite loop when 'this->oldestItemStartTime == newOldestTime'. |
|
Can you detail where/why the infinite loop would happen? |
|
PR reverted until the issue is clarified. |
This reverts commit 542db78. Infinite loop detected. Reverted until fixed.
|
Create a PlainTransport to receive data from ffmpeg. At this point the plainTransport sends an rtcp packet every second. And 'sendTransmission' 's windowSizeMs are also one second. When the program runs to ‘RateCalculator::RemoveOldData()’, When 'this->oldestItemStartTime == newOldestTime' happens at the same time as 'just one BufferItem in the RateCalculator::buffer'. It will remove this last BufferItem, so 'this->oldestItemStartTime' will set to 0. So that (this->oldestItemStartTime <= newOldestTime) ==> (0 <= newOldestTime) always true. |
|
Thanks. The commit has been reverted. In fact I found our demo server with the worker process in an infinite loop. Thanks. |
|
Oh. @rtctt thank you for reporting that. I'll prepare a new PR with proper fix and unit test later this week |
In the PR, besides fixing the bug described in #818, I also replaced the
if conditionwith an assert as the code under it is not supposed to be executed anyway. Moreover, the assertion allows to catch the bug by running the unit test forRTC::RateCalculator