resolve data race conditions, code quality

This commit is contained in:
David Zhao
2021-06-04 14:57:55 -07:00
parent 5baf97e99b
commit a3228c2ae9
17 changed files with 95 additions and 293 deletions
+3 -1
View File
@@ -189,7 +189,7 @@ func (c *RTCClient) Run() error {
})
// create a data channel, in order to work
_, err := c.publisher.PeerConnection().CreateDataChannel("_private", nil)
_, err := c.publisher.PeerConnection().CreateDataChannel("_lossy", nil)
if err != nil {
return err
}
@@ -353,6 +353,8 @@ func (c *RTCClient) SubscribedTracks() map[string][]*webrtc.TrackRemote {
}
func (c *RTCClient) RemoteParticipants() []*livekit.ParticipantInfo {
c.lock.Lock()
defer c.lock.Unlock()
return funk.Values(c.remoteParticipants).([]*livekit.ParticipantInfo)
}