mirror of
https://github.com/livekit/livekit.git
synced 2026-11-23 02:29:22 +00:00
Receiver reports counted packets restored by RTX or recovered by FlexFEC as received, so as long as repairs kept up the reported fraction lost stayed at zero, even with 20% upstream loss. libwebrtc receivers exclude recovered packets from their receive statistics, and a publisher's loss-based protection depends on that: with no reported loss, FlexFEC backs off to almost no repairs. Packets that fill a loss through a repair are now counted separately, and receiver reports include them in the fraction and cumulative loss. Reordered packets that arrive on their own still cancel the loss. The fraction is also capped at 255, so a full loss no longer wraps to zero. With 20% simulated upstream loss from an Android publisher, the reported fraction lost goes from 0 to about 0.15, the FEC packets received over 30 seconds go from 64 to 204, and the packets recovered by FEC from 11 to 61.