Handle prefer_regression for backup codec (#3554)

This commit is contained in:
cnderrauber
2025-03-26 16:27:50 +08:00
committed by GitHub
parent b0abb0ae6e
commit 2b6a46f402
6 changed files with 25 additions and 14 deletions
+3 -2
View File
@@ -53,8 +53,6 @@ const (
tokenDefaultTTL = 10 * time.Minute
)
var affinityEpoch = time.Date(2000, 0, 0, 0, 0, 0, 0, time.UTC)
type iceConfigCacheKey struct {
roomName livekit.RoomName
participantIdentity livekit.ParticipantIdentity
@@ -468,6 +466,9 @@ func (r *RoomManager) StartSession(
DataChannelMaxBufferedAmount: r.config.RTC.DataChannelMaxBufferedAmount,
DatachannelSlowThreshold: r.config.RTC.DatachannelSlowThreshold,
FireOnTrackBySdp: true,
ShouldRegressCodec: func() bool {
return r.config.Video.CodecRegressionThreshold == 0 || room.GetParticipantCount() < r.config.Video.CodecRegressionThreshold
},
})
if err != nil {
return err