Bring back soft close. (#2553)

Remote media track needs it.
This commit is contained in:
Raja Subramanian
2024-03-07 12:52:48 +05:30
committed by GitHub
parent d87f8aa299
commit 6c94185aa6
7 changed files with 107 additions and 20 deletions
+6 -2
View File
@@ -268,8 +268,12 @@ func (u *UpTrackManager) AddPublishedTrack(track types.MediaTrack) {
})
}
func (u *UpTrackManager) RemovePublishedTrack(track types.MediaTrack, willBeResumed bool) {
track.Close(willBeResumed)
func (u *UpTrackManager) RemovePublishedTrack(track types.MediaTrack, willBeResumed bool, shouldClose bool) {
if shouldClose {
track.Close(willBeResumed)
} else {
track.ClearAllReceivers(willBeResumed)
}
u.lock.Lock()
delete(u.publishedTracks, track.ID())
u.lock.Unlock()