Account for time before measurement available in connection quality. (#1528)

This commit is contained in:
Raja Subramanian
2023-03-19 18:34:56 +05:30
committed by GitHub
parent bbba3f8168
commit aeefbb080e
6 changed files with 119 additions and 51 deletions
+9 -1
View File
@@ -292,7 +292,7 @@ func (s *StreamTrackerManager) DistanceToDesired() float64 {
return 0
}
_, brs := s.getLayeredBitrateLocked()
al, brs := s.getLayeredBitrateLocked()
maxLayers := InvalidLayers
done:
@@ -308,6 +308,14 @@ done:
}
}
// before bit rate measurement is available, stream tracker could declare layer seen, account for that
for _, layer := range al {
if layer > maxLayers.Spatial {
maxLayers.Spatial = layer
maxLayers.Temporal = s.maxTemporalLayerSeen // till bit rate measurement is available, assume max seen as temporal
}
}
adjustedMaxLayers := maxLayers
if !maxLayers.IsValid() {
adjustedMaxLayers = VideoLayers{Spatial: 0, Temporal: 0}