Chaging VideoLayers -> VideoLayer (#1591)

There was mixed used. It is a struct. So, it is a singular.
Change all the places I could find. There may be more, but can be
changed when spotted.
This commit is contained in:
Raja Subramanian
2023-04-08 12:39:02 +05:30
committed by GitHub
parent e03f75d6a1
commit 4969b57c09
9 changed files with 420 additions and 422 deletions
+8 -8
View File
@@ -295,12 +295,12 @@ func (s *StreamTrackerManager) DistanceToDesired() float64 {
al, brs := s.getLayeredBitrateLocked()
maxLayers := buffer.InvalidLayers
maxLayer := buffer.InvalidLayer
done:
for s := int32(len(brs)) - 1; s >= 0; s-- {
for t := int32(len(brs[0])) - 1; t >= 0; t-- {
if brs[s][t] != 0 {
maxLayers = buffer.VideoLayer{
maxLayer = buffer.VideoLayer{
Spatial: s,
Temporal: t,
}
@@ -311,21 +311,21 @@ 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
if layer > maxLayer.Spatial {
maxLayer.Spatial = layer
maxLayer.Temporal = s.maxTemporalLayerSeen // till bit rate measurement is available, assume max seen as temporal
}
}
adjustedMaxLayers := maxLayers
if !maxLayers.IsValid() {
adjustedMaxLayers := maxLayer
if !maxLayer.IsValid() {
adjustedMaxLayers = buffer.VideoLayer{Spatial: 0, Temporal: 0}
}
distance :=
((s.maxExpectedLayer - adjustedMaxLayers.Spatial) * (s.maxTemporalLayerSeen + 1)) +
(s.maxTemporalLayerSeen - adjustedMaxLayers.Temporal)
if !maxLayers.IsValid() {
if !maxLayer.IsValid() {
distance++
}