From f6f6cca13354d5aae71395530dc9853059261893 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Tue, 23 Jul 2024 17:58:04 +0800 Subject: [PATCH] don't push 0 ssrc probing packets to pending queue (#2888) --- pkg/sfu/buffer/buffer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/sfu/buffer/buffer.go b/pkg/sfu/buffer/buffer.go index 5e17e073..023cade0 100644 --- a/pkg/sfu/buffer/buffer.go +++ b/pkg/sfu/buffer/buffer.go @@ -349,6 +349,13 @@ func (b *Buffer) Write(pkt []byte) (n int, err error) { } } + // libwebrtc will use 0 ssrc for probing, don't push the packet to pending queue to avoid memory increasing since + // the Bind will not be called to consume the pending packets. More details in https://github.com/pion/webrtc/pull/2816 + if rtpPacket.SSRC == 0 { + b.Unlock() + return + } + // handle RTX packet if pb := b.primaryBufferForRTX; pb != nil { b.Unlock()