Ensure subscribe data track handles are unique (#4162)

This commit is contained in:
Raja Subramanian
2025-12-16 13:52:05 +05:30
committed by GitHub
parent a26c48304a
commit 5964efbba5
7 changed files with 95 additions and 17 deletions
+8 -4
View File
@@ -18,6 +18,7 @@ import (
"context"
"fmt"
"io"
"math/rand"
"os"
"slices"
"strings"
@@ -271,6 +272,8 @@ type ParticipantImpl struct {
*UpDataTrackManager
*SubscriptionManager
nextSubscribedDataTrackHandle uint16
icQueue [2]atomic.Pointer[webrtc.ICECandidate]
requireBroadcast bool
@@ -358,10 +361,11 @@ func NewParticipant(params ParticipantParams) (*ParticipantImpl, error) {
joiningMessageFirstSeqs: make(map[livekit.ParticipantID]uint32),
joiningMessageLastWrittenSeqs: make(map[livekit.ParticipantID]uint32),
},
rpcPendingAcks: make(map[string]*utils.DataChannelRpcPendingAckHandler),
rpcPendingResponses: make(map[string]*utils.DataChannelRpcPendingResponseHandler),
onClose: make(map[string]func(types.LocalParticipant)),
telemetryGuard: &telemetry.ReferenceGuard{},
rpcPendingAcks: make(map[string]*utils.DataChannelRpcPendingAckHandler),
rpcPendingResponses: make(map[string]*utils.DataChannelRpcPendingResponseHandler),
onClose: make(map[string]func(types.LocalParticipant)),
telemetryGuard: &telemetry.ReferenceGuard{},
nextSubscribedDataTrackHandle: uint16(rand.Intn(256)),
}
p.setupSignalling()