From adf971f5b103603e1e0bd17c9278e63225592a2c Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 3 Aug 2023 14:04:10 +0530 Subject: [PATCH] Do not post max layer event for audio. (#1932) * Do not post max layer event for audio. A bunch of event queue full warnings on audio tracks :-() * Don't need a deep channel --- pkg/sfu/downtrack.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/sfu/downtrack.go b/pkg/sfu/downtrack.go index eabfa709..d204b8c3 100644 --- a/pkg/sfu/downtrack.go +++ b/pkg/sfu/downtrack.go @@ -294,7 +294,7 @@ func NewDownTrack(params DowntrackParams) (*DownTrack, error) { kind: kind, codec: codecs[0].RTPCodecCapability, pacer: params.Pacer, - maxLayerNotifierCh: make(chan struct{}, 20), + maxLayerNotifierCh: make(chan struct{}, 1), } d.forwarder = NewForwarder( d.kind, @@ -612,14 +612,13 @@ func (d *DownTrack) keyFrameRequester(generation uint32, layer int32) { } func (d *DownTrack) postMaxLayerNotifierEvent() { - if d.IsClosed() { + if d.IsClosed() || d.kind != webrtc.RTPCodecTypeVideo { return } select { case d.maxLayerNotifierCh <- struct{}{}: default: - d.params.Logger.Warnw("max layer notifier event queue full", nil) } }