ignore duplicate tracks being published

This commit is contained in:
David Zhao
2021-01-27 09:42:02 -08:00
parent 08f5957d65
commit 0813a55617
2 changed files with 52 additions and 19 deletions
+5
View File
@@ -251,6 +251,11 @@ func (p *ParticipantImpl) AddTrack(clientId, name string, trackType livekit.Trac
p.lock.Lock()
defer p.lock.Unlock()
// if track is already published, reject
if p.pendingTracks[clientId] != nil {
return
}
ti := &livekit.TrackInfo{
Type: trackType,
Name: name,