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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user