1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-26 02:25:58 +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) { func (up *upTrack) addLocal(local *downTrack) {
up.mu.Lock() up.mu.Lock()
for _, t := range up.local {
if t == local {
up.mu.Unlock()
return
}
}
up.local = append(up.local, local) up.local = append(up.local, local)
up.mu.Unlock() up.mu.Unlock()
up.notifyLocal() up.notifyLocal()