protocol/rtsp: NewClient u parameter now addr and client instance not s now c

This commit is contained in:
Saxon 2019-04-28 00:50:17 +09:30
parent 77094acc67
commit 2f752d5b7f
1 changed files with 5 additions and 5 deletions

View File

@ -45,18 +45,18 @@ type Client struct {
// NewClient returns a pointer to a new Client. The URL u will be parsed and
// a connection to the RTSP server will be made.
func NewClient(u string) (*Client, error) {
s := &Client{addr: u}
func NewClient(addr string) (*Client, error) {
c := &Client{addr: addr}
var err error
s.url, err = url.Parse(u)
c.url, err = url.Parse(addr)
if err != nil {
return nil, err
}
s.conn, err = net.Dial("tcp", s.url.Host)
c.conn, err = net.Dial("tcp", c.url.Host)
if err != nil {
return nil, err
}
return s, nil
return c, nil
}
// Describe forms and sends an RTSP request of method DESCRIBE to the RTSP server.