From 66a3a8e02815d40a14cda93c5536f0f6c06a50a7 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Fri, 10 May 2024 12:32:28 +0530 Subject: [PATCH] cond broadcast always. (#2699) With Read and ReadExtended waiting (they are two different goroutines), use Broadcast always. In theory, they both should not be waiting at the same time, but just being safe. --- pkg/sfu/buffer/buffer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sfu/buffer/buffer.go b/pkg/sfu/buffer/buffer.go index 64ff2891..5474c266 100644 --- a/pkg/sfu/buffer/buffer.go +++ b/pkg/sfu/buffer/buffer.go @@ -336,14 +336,14 @@ func (b *Buffer) Write(pkt []byte) (n int, err error) { arrivalTime: now, }) b.Unlock() - b.readCond.Signal() + b.readCond.Broadcast() return } b.payloadType = rtpPacket.PayloadType b.calc(pkt, &rtpPacket, time.Now(), false) b.Unlock() - b.readCond.Signal() + b.readCond.Broadcast() return }