mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 13:25:42 +00:00
When SetMaxSpatialLayer() is called with target/current layers in InvalidLayerSpatial state, opportunistically initialize the target layer to avoid dropped packets during async stream allocator initialization. Guards: - Only sets target if not congestion-throttled (isDeficientLocked) - Does not set current layer (deferred to keyframe-based forwarder start) - Logs at Debug level to avoid log noise This prevents undefined layer state during manual subscription with immediate quality upgrades (WithAutoSubscribe(false) + SetVideoQuality(HIGH)).