Fixed unclean DownTrack close when removed before bound. (#736)

* Fixed unclean DownTrack close when removed before bound.

When a DownTrack is closed before it had a chance to be bound to a
transceiver, we'd skip close and leave it hanging. This is unlikely in
normal operations. However, it can be seen with permissions and
subscription APIs.

* remove remaining peerID references
This commit is contained in:
David Zhao
2022-05-29 22:09:02 -07:00
committed by GitHub
parent 3a45f93fdd
commit 7ad51f49f1
8 changed files with 120 additions and 98 deletions
+2 -1
View File
@@ -38,7 +38,8 @@ func HandleParticipantSignal(room types.Room, participant types.LocalParticipant
participant.SetTrackMuted(livekit.TrackID(msg.Mute.Sid), msg.Mute.Muted, false)
case *livekit.SignalRequest_Subscription:
var err error
if participant.CanSubscribe() {
// always allow unsubscribe
if participant.CanSubscribe() || !msg.Subscription.Subscribe {
updateErr := room.UpdateSubscriptions(
participant,
livekit.StringsAsTrackIDs(msg.Subscription.TrackSids),