Sort codec layers when adding track (#3998)
This commit is contained in:
@@ -2914,6 +2914,9 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l
|
||||
for _, l := range layers {
|
||||
clonedLayers = append(clonedLayers, utils.CloneProto(l))
|
||||
}
|
||||
slices.SortFunc(clonedLayers, func(i, j *livekit.VideoLayer) int {
|
||||
return int(i.Quality) - int(j.Quality)
|
||||
})
|
||||
return clonedLayers
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user