use pending lock, no need for participant lock (#2793)
This commit is contained in:
@@ -779,8 +779,9 @@ func (p *ParticipantImpl) AddTrack(req *livekit.AddTrackRequest) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.lock.Lock()
|
p.pendingTracksLock.Lock()
|
||||||
defer p.lock.Unlock()
|
defer p.pendingTracksLock.Unlock()
|
||||||
|
|
||||||
ti := p.addPendingTrackLocked(req)
|
ti := p.addPendingTrackLocked(req)
|
||||||
if ti == nil {
|
if ti == nil {
|
||||||
return
|
return
|
||||||
@@ -1767,9 +1768,6 @@ func (p *ParticipantImpl) onSubscribedMaxQualityChange(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *livekit.TrackInfo {
|
func (p *ParticipantImpl) addPendingTrackLocked(req *livekit.AddTrackRequest) *livekit.TrackInfo {
|
||||||
p.pendingTracksLock.Lock()
|
|
||||||
defer p.pendingTracksLock.Unlock()
|
|
||||||
|
|
||||||
if req.Sid != "" {
|
if req.Sid != "" {
|
||||||
track := p.GetPublishedTrack(livekit.TrackID(req.Sid))
|
track := p.GetPublishedTrack(livekit.TrackID(req.Sid))
|
||||||
if track == nil {
|
if track == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user