mirror of
https://github.com/livekit/livekit.git
synced 2026-05-24 10:15:28 +00:00
Do not calculate distance if max layers are not valid (#1515)
This commit is contained in:
@@ -306,6 +306,10 @@ done:
|
||||
}
|
||||
}
|
||||
|
||||
if !maxLayers.IsValid() || s.maxTemporalLayerSeen < 0 {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
distance := float64(0.0)
|
||||
for sp := maxLayers.Spatial; sp <= s.getMaxExpectedLayerLocked(); sp++ {
|
||||
for t := maxLayers.Temporal; t <= s.maxTemporalLayerSeen; t++ {
|
||||
@@ -313,10 +317,6 @@ done:
|
||||
}
|
||||
}
|
||||
|
||||
if s.maxTemporalLayerSeen < 0 {
|
||||
return distance
|
||||
}
|
||||
|
||||
return distance / float64(s.maxTemporalLayerSeen+1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user