Add timeout query param to RTSP incoming source #1118
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user