Record dynacast requirement of a subscriber synchronously. (#834)

With rapid changes to subscription settings, use of a goroutine
could end up processing dynacast needs for that subscriber in
a different order. So, record the susbcription needs of a subscriber
in the callback and process the data in a go routine.
This commit is contained in:
Raja Subramanian
2022-07-15 11:46:02 +05:30
committed by GitHub
parent a0578db3ed
commit 4c7d3161a9
3 changed files with 9 additions and 7 deletions
+2
View File
@@ -973,6 +973,7 @@ func (p *ParticipantImpl) UpdateSubscribedTrackSettings(trackID livekit.TrackID,
subTrack := p.subscribedTracks[trackID]
if subTrack == nil {
// will get set when subscribed track is added
p.lock.Unlock()
p.params.Logger.Infow("could not find subscribed track", "trackID", trackID)
return nil
@@ -1969,6 +1970,7 @@ func (p *ParticipantImpl) rtcpSendWorker() {
// read from rtcpChan
for pkts := range p.rtcpCh {
if pkts == nil {
p.params.Logger.Infow("exiting RTCP send worker")
return
}