Code refactoring

This commit is contained in:
Alexey Khit
2022-09-16 17:00:56 +03:00
parent fa23bb6899
commit 428628fcce
+4 -4
View File
@@ -157,15 +157,15 @@ func worker(address string) {
log.Debug().Str("stream", name).Msg("[rtsp] new producer") log.Debug().Str("stream", name).Msg("[rtsp] new producer")
str := streams.Get(conn.URL.Path[1:]) stream := streams.Get(name)
if str == nil { if stream == nil {
return return
} }
str.AddProducer(conn) stream.AddProducer(conn)
onDisconnect = func() { onDisconnect = func() {
str.RemoveProducer(conn) stream.RemoveProducer(conn)
} }
case streamer.StatePlaying: case streamer.StatePlaying: