Protect against looking up dimensions for invalid spatial layer (#977)

Also use loss based scoring when track dimensions are not available.
This commit is contained in:
Raja Subramanian
2022-09-03 00:59:47 +05:30
committed by GitHub
parent f2aee4160e
commit c75f38bce6
2 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ func VideoTrackScore(params TrackScoreParams, normFactor float32) float32 {
// the resolution is high. Till rtcmos model can be adapted to that
// scenario, use loss based scoring.
//
func ScreenshareTrackScore(params TrackScoreParams) float32 {
func LossBasedTrackScore(params TrackScoreParams) float32 {
pctLoss := getLossPercentage(params.PacketsExpected, params.PacketsLost)
// No Loss, excellent
if pctLoss == 0.0 && !params.IsReducedQuality {