Re-use transceiver (via ReplaceTrack) if a down track is going to be resumed. (#785)
* WIP commit * Clean up * spelling mistake * Run subscribed track onBind in a go routine * Address comments and more safety net
This commit is contained in:
@@ -240,7 +240,9 @@ func (s *StreamAllocator) AddTrack(downTrack *DownTrack, params AddTrackParams)
|
||||
|
||||
func (s *StreamAllocator) RemoveTrack(downTrack *DownTrack) {
|
||||
s.videoTracksMu.Lock()
|
||||
delete(s.videoTracks, livekit.TrackID(downTrack.ID()))
|
||||
if existing := s.videoTracks[livekit.TrackID(downTrack.ID())]; existing != nil && existing.DownTrack() == downTrack {
|
||||
delete(s.videoTracks, livekit.TrackID(downTrack.ID()))
|
||||
}
|
||||
s.videoTracksMu.Unlock()
|
||||
|
||||
// LK-TODO: use any saved bandwidth to re-distribute
|
||||
|
||||
Reference in New Issue
Block a user