uptrackmanager reuse (#318)

* WIP commit

* Remove the double lock

* Remove unused variable

* WIP commit

* Fix test

* WIP commit

* Split out MediaTrackReceiver

* Address comments from David
This commit is contained in:
Raja Subramanian
2022-01-09 10:45:49 +05:30
committed by GitHub
parent 8582ca4c9b
commit a9e0598210
12 changed files with 1007 additions and 866 deletions
+5
View File
@@ -635,10 +635,15 @@ func (r *Room) subscribeToExistingTracks(p types.Participant) {
// broadcast an update about participant p
func (r *Room) broadcastParticipantState(p types.Participant, skipSource bool) {
//
// This is a critical section to ensure that participant update time and
// the corresponding data are paired properly.
//
r.lock.Lock()
updatedAt := time.Now()
updates := ToProtoParticipants([]types.Participant{p})
r.lock.Unlock()
if p.Hidden() {
if !skipSource {
// send update only to hidden participant