Add support custom timeout for RTSP source

This commit is contained in:
Alexey Khit
2023-08-23 14:08:15 +03:00
parent b1c0a28366
commit 9f9dc7e844
6 changed files with 24 additions and 13 deletions
+5 -1
View File
@@ -31,7 +31,11 @@ func (c *Conn) Dial() (err error) {
var conn net.Conn
if c.Transport == "" {
conn, err = tcp.Dial(c.URL, "554")
timeout := core.ConnDialTimeout
if c.Timeout != 0 {
timeout = time.Second * time.Duration(c.Timeout)
}
conn, err = tcp.Dial(c.URL, "554", timeout)
} else {
conn, err = websocket.Dial(c.Transport)
}