Code refactoring
This commit is contained in:
+4
-4
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user