Adds RTSP client custom keepalive timeout

This commit is contained in:
Alexey Khit
2023-04-17 16:54:02 +03:00
parent 6cef5faf27
commit 76ec70d2a0
2 changed files with 21 additions and 14 deletions
+3 -3
View File
@@ -246,10 +246,10 @@ func (c *Conn) SetupMedia(media *core.Media) (byte, error) {
if c.session == "" {
// Session: 216525287999;timeout=60
if s := res.Header.Get("Session"); s != "" {
if j := strings.IndexByte(s, ';'); j > 0 {
s = s[:j]
c.session, s, _ = strings.Cut(s, ";timeout=")
if s != "" {
c.keepalive, _ = strconv.Atoi(s)
}
c.session = s
}
}