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 -2
View File
@@ -35,12 +35,12 @@ func PackDataTrackLabel(participantID livekit.ParticipantID, trackID livekit.Tra
return string(participantID) + trackIdSeparator + string(trackID) + trackIdSeparator + label
}
func UnpackDataTrackLabel(packed string) (peerID livekit.ParticipantID, trackID livekit.TrackID, label string) {
func UnpackDataTrackLabel(packed string) (participantID livekit.ParticipantID, trackID livekit.TrackID, label string) {
parts := strings.Split(packed, trackIdSeparator)
if len(parts) != 3 {
return "", livekit.TrackID(packed), ""
}
peerID = livekit.ParticipantID(parts[0])
participantID = livekit.ParticipantID(parts[0])
trackID = livekit.TrackID(parts[1])
label = parts[2]
return