1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 23:35:46 +01:00

Don't add duplicates in addLocal.

This commit is contained in:
Juliusz Chroboczek 2020-05-22 16:55:56 +02:00
parent 9575b80893
commit 2a35f4e5d9

View file

@ -52,6 +52,12 @@ func (up *upTrack) notifyLocal() {
func (up *upTrack) addLocal(local *downTrack) {
up.mu.Lock()
for _, t := range up.local {
if t == local {
up.mu.Unlock()
return
}
}
up.local = append(up.local, local)
up.mu.Unlock()
up.notifyLocal()