use proper fix for using shared bufferFactory, remove resync hack

This commit is contained in:
David Zhao
2021-02-07 23:06:16 -08:00
parent e30c9f706c
commit f1f5b8dafe
7 changed files with 4 additions and 55 deletions
-15
View File
@@ -580,8 +580,6 @@ func (p *ParticipantImpl) onMediaTrack(track *webrtc.TrackRemote, rtpReceiver *w
if newTrack {
p.handleTrackPublished(mt)
}
p.resyncSubscriptions()
}
func (p *ParticipantImpl) onDataChannel(dc *webrtc.DataChannel) {
@@ -646,7 +644,6 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) {
p.onTrackUpdated(p, track)
}
track.OnClose(nil)
go p.resyncSubscriptions()
})
if p.onTrackPublished != nil {
@@ -654,18 +651,6 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) {
}
}
func (p *ParticipantImpl) resyncSubscriptions() {
// TODO: video tracks the current participant is subscribed to tends to freeze when the participant adds/removes tracks
// to get around this, we'll trigger a resync on all tracks it's subscribed to
p.lock.RLock()
defer p.lock.RUnlock()
for _, tracks := range p.subscribedTracks {
for _, subTrack := range tracks {
subTrack.Resync()
}
}
}
// downTracksRTCPWorker sends SenderReports periodically when the participant is subscribed to
// other publishedTracks in the room.
func (p *ParticipantImpl) downTracksRTCPWorker() {