From ec79043b04800e522d922bd274983b49caec988a Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Wed, 5 Aug 2020 10:18:38 +0200 Subject: [PATCH] add clients to udpClientPublishers only if protocol is udp --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index af1ab82f..84abaed7 100644 --- a/main.go +++ b/main.go @@ -421,14 +421,18 @@ outer: case programEventClientRecord: p.publisherCount += 1 evt.client.state = clientStateRecord - p.udpClientPublishers[makeIpKey(evt.client.ip())] = evt.client + if evt.client.streamProtocol == gortsplib.StreamProtocolUdp { + p.udpClientPublishers[makeIpKey(evt.client.ip())] = evt.client + } p.paths[evt.client.pathId].publisherSetReady() close(evt.done) case programEventClientRecordStop: p.publisherCount -= 1 evt.client.state = clientStatePreRecord - delete(p.udpClientPublishers, makeIpKey(evt.client.ip())) + if evt.client.streamProtocol == gortsplib.StreamProtocolUdp { + delete(p.udpClientPublishers, makeIpKey(evt.client.ip())) + } p.paths[evt.client.pathId].publisherSetNotReady() close(evt.done)