From 2c2a1a359a64fb15d0cf2bbdecc55c76337d1cf3 Mon Sep 17 00:00:00 2001 From: Mathis Engelbart Date: Fri, 4 Sep 2026 10:13:02 +0200 Subject: [PATCH] Remove fallback because peer will only send TWCC The peer negotiated TWCC so this is what is will send us. Falling back to sequence numbers doesn't help here because we won't be able to match the numbers to the incoming TWCC reports. We only push items to the history that will never be used. Also reduce the logging by logging the warning once instead of repeating it for every packet. --- pkg/rtpfb/interceptor.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkg/rtpfb/interceptor.go b/pkg/rtpfb/interceptor.go index 723327b2..8ba039bf 100644 --- a/pkg/rtpfb/interceptor.go +++ b/pkg/rtpfb/interceptor.go @@ -110,6 +110,8 @@ type Interceptor struct { } func (i *Interceptor) bindTWCCStream(twccHdrExtID uint8, writer interceptor.RTPWriter) interceptor.RTPWriter { + loggedMissingExt := false + return interceptor.RTPWriterFunc(func( header *rtp.Header, payload []byte, @@ -119,12 +121,14 @@ func (i *Interceptor) bindTWCCStream(twccHdrExtID uint8, writer interceptor.RTPW var twccHdrExt rtp.TransportCCExtension if err := twccHdrExt.Unmarshal(header.GetExtension(twccHdrExtID)); err != nil { - i.log.Warnf( - "CCFB configured for TWCC, but failed to get TWCC header extension from outgoing packet."+ - "Falling back to saving history for CCFB feedback reports. err: %v", - err, - ) - i.history.addOutgoing(header.SSRC, header.SequenceNumber, false, 0, header.MarshalSize()+len(payload), ts) + if !loggedMissingExt { + i.log.Warnf( + "CCFB configured for TWCC, but failed to get TWCC header extension from outgoing packet."+ + "Packets without the extension cannot be tracked and will not appear in feedback reports. err: %v", + err, + ) + loggedMissingExt = true + } return writer.Write(header, payload, attributes) }