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
+12
View File
@@ -139,3 +139,15 @@ func (p *ParticipantImpl) onReceivedDataTrackMessage(data []byte) {
p.listener().OnDataTrackMessage(p, data, &packet)
}
func (p *ParticipantImpl) GetNextSubscribedDataTrackHandle() uint16 {
p.lock.Lock()
defer p.lock.Unlock()
p.nextSubscribedDataTrackHandle++
if p.nextSubscribedDataTrackHandle == 0 {
p.nextSubscribedDataTrackHandle++
}
return p.nextSubscribedDataTrackHandle
}