1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-28 02:12:20 +02:00

Make client count independant of outputs

This commit is contained in:
Alexandre Iooss
2020-10-17 16:17:19 +02:00
parent 70798ce1df
commit f0990a630d
3 changed files with 24 additions and 16 deletions

View File

@ -66,7 +66,8 @@ func handleViewer(s *srtgo.SrtSocket, streams map[string]*stream.Stream, name st
// Register new output
c := make(chan []byte, 128)
st.Register(c, false)
st.Register(c)
st.IncrementClientCount()
// Receive data and send them
for data := range c {
@ -84,6 +85,7 @@ func handleViewer(s *srtgo.SrtSocket, streams map[string]*stream.Stream, name st
}
// Close output
st.Unregister(c, false)
st.Unregister(c)
st.DecrementClientCount()
s.Close()
}