From 95bc5b9849c6e740d0e6f020ada2851d48ea6a5a Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Wed, 8 Feb 2023 18:54:54 +0530 Subject: [PATCH] Trigger max layer switch when downgrading. (#1398) When downgrading (could be due to overshoot or opportunistically locking to a higher layer), need to check if the max layer notification needs to be done so that dynacast has the right max layer for the participant corresponding to this downtrack. --- pkg/sfu/forwarder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/sfu/forwarder.go b/pkg/sfu/forwarder.go index 0cd185f65..2ce1fcdbe 100644 --- a/pkg/sfu/forwarder.go +++ b/pkg/sfu/forwarder.go @@ -1641,6 +1641,10 @@ func (f *Forwarder) getTranslationParamsVideo(extPkt *buffer.ExtPacket, layer in f.logger.Infow("adjusting overshoot", "current", f.currentLayers, "target", f.targetLayers, "adjuted", layer) f.currentLayers.Spatial = layer f.targetLayers.Spatial = layer + + if f.currentLayers.Spatial >= f.maxLayers.Spatial || f.currentLayers.Spatial == (f.numAdvertisedLayers-1) { + tp.isSwitchingToMaxLayer = true + } } } }