Clear rids if not present in SDP. (#3731)
This commit is contained in:
@@ -999,11 +999,6 @@ func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) {
|
||||
continue
|
||||
}
|
||||
|
||||
rids, ok := sdpHelper.GetSimulcastRids(m)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
mst := sdpHelper.GetMediaStreamTrack(m)
|
||||
if mst == "" {
|
||||
continue
|
||||
@@ -1012,6 +1007,8 @@ func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) {
|
||||
p.pendingTracksLock.Lock()
|
||||
pti := p.pendingTracks[mst]
|
||||
if pti != nil {
|
||||
rids, ok := sdpHelper.GetSimulcastRids(m)
|
||||
if ok {
|
||||
// does not work for clients that use a different media stream track in SDP (e.g. Firefox)
|
||||
// one option is to look up by track type, but that fails when there are multiple pending tracks
|
||||
// of the same type
|
||||
@@ -1028,6 +1025,11 @@ func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) {
|
||||
"trackID", pti.trackInfos[0].Sid,
|
||||
"pendingTrack", pti,
|
||||
)
|
||||
} else {
|
||||
for i := 0; i < len(pti.sdpRids); i++ {
|
||||
pti.sdpRids[i] = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
p.pendingTracksLock.Unlock()
|
||||
}
|
||||
@@ -2816,7 +2818,6 @@ func (p *ParticipantImpl) mediaTrackReceived(track sfu.TrackRemote, rtpReceiver
|
||||
ti.Version = p.params.VersionGenerator.Next().ToProto()
|
||||
}
|
||||
|
||||
if len(sdpRids) != 0 {
|
||||
for _, layer := range ti.Layers {
|
||||
layer.SpatialLayer = buffer.VideoQualityToSpatialLayer(layer.Quality, ti)
|
||||
layer.Rid = buffer.VideoQualityToRid(layer.Quality, ti, sdpRids)
|
||||
@@ -2832,7 +2833,6 @@ func (p *ParticipantImpl) mediaTrackReceived(track sfu.TrackRemote, rtpReceiver
|
||||
layer.Rid = buffer.VideoQualityToRid(layer.Quality, ti, sdpRids)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mt = p.addMediaTrack(signalCid, track.ID(), ti, sdpRids)
|
||||
newTrack = true
|
||||
|
||||
Reference in New Issue
Block a user