Skip to content

Commit 23ec0be

Browse files
committed
Check rid and sessionId in addTrack
Otherwise reconnects would ignore streams with duplicate RIDs
1 parent 8bfcd60 commit 23ec0be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/webrtc/webrtc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func addTrack(stream *stream, rid, sessionId string) (*videoTrack, error) {
163163
defer streamMapLock.Unlock()
164164

165165
for i := range stream.videoTracks {
166-
if rid == stream.videoTracks[i].rid {
166+
if rid == stream.videoTracks[i].rid && sessionId == stream.videoTracks[i].sessionId {
167167
return stream.videoTracks[i], nil
168168
}
169169
}

0 commit comments

Comments
 (0)