mirror of
https://github.com/livekit/livekit.git
synced 2026-11-23 02:29:22 +00:00
A packet repaired from RTX takes its header from the RTX packet: libwebrtc adds a MID to retransmissions until the RTX SSRC is acknowledged, and sets abs-send-time and transport-cc at send time. The stored packet therefore differs from the media the publisher protected, so using it as a protected packet recovered the wrong length, failing with "invalid recovered packet size", or silently corrupted the recovered packet's header extensions when the length happened to match. Like libwebrtc's FlexfecReceiver, which skips packets recovered by RTX, mark RTX repaired sequence numbers and treat them as missing for FEC recovery. They are still forwarded and update NACK state as before. With a libwebrtc publisher at 10% upstream loss, every recovery attempt in a block containing a retransmitted packet failed; with retransmissions excluded recoveries succeed.