Add timeout query param to RTSP incoming source #1118

This commit is contained in:
Alex X
2024-05-24 16:26:06 +03:00
parent b3e9ed23ac
commit d9d2bdff44
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -210,6 +210,11 @@ func tcpHandler(conn *rtsp.Conn) {
return
}
query := conn.URL.Query()
if s := query.Get("timeout"); s != "" {
conn.Timeout = core.Atoi(s)
}
log.Debug().Str("stream", name).Msg("[rtsp] new producer")
stream.AddProducer(conn)
+5 -1
View File
@@ -124,7 +124,11 @@ func (c *Conn) Handle() (err error) {
case core.ModePassiveProducer:
// polling frames from remote RTSP Client (ex FFmpeg)
timeout = time.Second * 15
if c.Timeout == 0 {
timeout = time.Second * 15
} else {
timeout = time.Second * time.Duration(c.Timeout)
}
case core.ModePassiveConsumer:
// pushing frames to remote RTSP Client (ex VLC)