mirror of https://github.com/EasyDarwin/EasyDarwin
修改了某些地址拉不到流的问题
parent
2b79eec814
commit
e02b12bb68
|
@ -151,6 +151,7 @@ func (client *RTSPClient) Start(timeout time.Duration) error {
|
||||||
}
|
}
|
||||||
client.Sdp = sess
|
client.Sdp = sess
|
||||||
client.SDPRaw = resp.Body
|
client.SDPRaw = resp.Body
|
||||||
|
Session := ""
|
||||||
for _, media := range sess.Media {
|
for _, media := range sess.Media {
|
||||||
switch media.Type {
|
switch media.Type {
|
||||||
case "video":
|
case "video":
|
||||||
|
@ -168,6 +169,7 @@ func (client *RTSPClient) Start(timeout time.Duration) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Session = resp.Header["Session"]
|
||||||
case "audio":
|
case "audio":
|
||||||
client.AControl = media.Attributes.Get("control")
|
client.AControl = media.Attributes.Get("control")
|
||||||
client.VCodec = media.Formats[0].Name
|
client.VCodec = media.Formats[0].Name
|
||||||
|
@ -183,9 +185,13 @@ func (client *RTSPClient) Start(timeout time.Duration) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Session = resp.Header["Session"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
headers = make(map[string]string)
|
headers = make(map[string]string)
|
||||||
|
if Session != "" {
|
||||||
|
headers["Session"] = Session
|
||||||
|
}
|
||||||
resp, err = client.Request("PLAY", headers)
|
resp, err = client.Request("PLAY", headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue