Fix race (concurency) for Track

This commit is contained in:
Alexey Khit
2022-11-22 20:03:36 +03:00
parent 3d6472cfb1
commit 0e281e36d3
6 changed files with 15 additions and 24 deletions

View File

@@ -75,7 +75,7 @@ func (c *Client) GetTrack(media *streamer.Media, codec *streamer.Codec) *streame
}
}
track := &streamer.Track{Codec: codec, Direction: media.Direction}
track := streamer.NewTrack(codec, media.Direction)
c.tracks = append(c.tracks, track)
return track
}