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
This commit is contained in:
Raja Subramanian
2023-08-03 14:04:10 +05:30
committed by GitHub
parent eadc910bff
commit adf971f5b1
+2 -3
View File
@@ -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)
}
}