Skip to content

Commit

Permalink
client: fix RTSPS default port
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Jul 9, 2022
1 parent 4941ef5 commit 36c6d0b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,14 @@ func (c *Client) connOpen() error {
return fmt.Errorf("RTSPS can be used only with TCP")
}

if !strings.Contains(c.host, ":") {
c.host += ":554"
// add default port
_, _, err := net.SplitHostPort(c.host)
if err != nil {
if c.scheme == "rtsp" {
c.host = net.JoinHostPort(c.host, "554")
} else { // rtsps
c.host = net.JoinHostPort(c.host, "8322")
}
}

ctx, cancel := context.WithTimeout(c.ctx, c.ReadTimeout)
Expand Down

0 comments on commit 36c6d0b

Please sign in to comment.