Select highest layer of equal dimensions (#1841)
* Select highest layer of equal dimensions * clean up test
This commit is contained in:
@@ -681,11 +681,13 @@ func (t *MediaTrackReceiver) GetQualityForDimension(width, height uint32) liveki
|
||||
})
|
||||
}
|
||||
|
||||
// finds the lowest layer that could satisfy client demands
|
||||
// finds the highest layer with smallest dimensions that still satisfy client demands
|
||||
requestedSize = uint32(float32(requestedSize) * layerSelectionTolerance)
|
||||
for i, s := range layerSizes {
|
||||
quality = livekit.VideoQuality(i)
|
||||
if s >= requestedSize {
|
||||
if i == len(layerSizes)-1 {
|
||||
break
|
||||
} else if s >= requestedSize && s != layerSizes[i+1] {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user