Commit 2a35f4e5 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't add duplicates in addLocal.

parent 9575b808
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment