protocol/rtsp: renamed urlStr to addr

This commit is contained in:
Saxon 2019-04-26 14:08:58 +09:30
parent cd18d9f5a7
commit 4e98b4d2ea
1 changed files with 6 additions and 6 deletions

View File

@ -38,7 +38,7 @@ import (
// Client describes an RTSP Client. // Client describes an RTSP Client.
type Client struct { type Client struct {
cSeq int cSeq int
urlStr string addr string
url *url.URL url *url.URL
conn net.Conn conn net.Conn
} }
@ -46,7 +46,7 @@ type Client struct {
// NewClient returns a pointer to a new Client. The URL u will be parsed and // NewClient returns a pointer to a new Client. The URL u will be parsed and
// a connection to the RTSP server will be made. // a connection to the RTSP server will be made.
func NewClient(u string) (*Client, error) { func NewClient(u string) (*Client, error) {
s := &Client{urlStr: u} s := &Client{addr: u}
var err error var err error
s.url, err = url.Parse(u) s.url, err = url.Parse(u)
if err != nil { if err != nil {
@ -71,7 +71,7 @@ func (s *Client) Options() (*Response, error) {
// Setup forms and sends an RTSP request of method SETUP to the RTSP server. // Setup forms and sends an RTSP request of method SETUP to the RTSP server.
func (s *Client) Setup(track, transport string) (*Response, error) { func (s *Client) Setup(track, transport string) (*Response, error) {
url, err := url.Parse(s.urlStr + "/" + track) url, err := url.Parse(s.addr + "/" + track)
if err != nil { if err != nil {
return nil, err return nil, err
} }