mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 19:43:01 +00:00
Populate simulcast codec layers. (#2334)
Previously, it was done on read. Missed populating it on write in the TrackInfo consolidation effort. Fix by populating layers when adding pending track itself. As all codecs will have same layers, clone the top level layers and add it all codecs.
This commit is contained in:
1 parent
a4888fcf8f
commit
4c1047d8c3
1 file changed
+6
@@ -1670,9 +1670,15 @@ func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *l
|
||||
continue
|
||||
}
|
||||
seenCodecs[mime] = struct{}{}
|
||||
|
||||
clonedLayers := make([]*livekit.VideoLayer, 0, len(req.Layers))
|
||||
for _, l := range req.Layers {
|
||||
clonedLayers = append(clonedLayers, proto.Clone(l).(*livekit.VideoLayer))
|
||||
}
|
||||
ti.Codecs = append(ti.Codecs, &livekit.SimulcastCodecInfo{
|
||||
MimeType: mime,
|
||||
Cid: codec.Cid,
|
||||
Layers: clonedLayers,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user