mirror of https://bitbucket.org/ausocean/av.git
protocol/rtsp: NewClient u parameter now addr and client instance not s now c
This commit is contained in:
parent
77094acc67
commit
2f752d5b7f
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue