Browse Source

RTSP source: build track URLs by using Content-Base when provided by server, fixing many timeouts

pull/340/head
aler9 4 years ago
parent
commit
9287e0fe98
  1. 2
      go.mod
  2. 4
      go.sum
  3. 3
      internal/clientrtsp/client.go

2
go.mod

@ -5,7 +5,7 @@ go 1.15 @@ -5,7 +5,7 @@ go 1.15
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/aler9/gortsplib v0.0.0-20210402161256-ab6826e6a7ce
github.com/aler9/gortsplib v0.0.0-20210403142314-1f8d7a9ae761
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51

4
go.sum

@ -2,8 +2,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo @@ -2,8 +2,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aler9/gortsplib v0.0.0-20210402161256-ab6826e6a7ce h1:Fv9ds+JR8aE3EHJG6kWK2UyfqvPTg6WuYg6nAN9t77A=
github.com/aler9/gortsplib v0.0.0-20210402161256-ab6826e6a7ce/go.mod h1:zVCg+TQX445hh1pC5QgAuuBvvXZMWLY1XYz626dGFqY=
github.com/aler9/gortsplib v0.0.0-20210403142314-1f8d7a9ae761 h1:Pr4W/DxrmzxYSIf2OwCO4+6NbwWcKOasv7ZmjkNLwbY=
github.com/aler9/gortsplib v0.0.0-20210403142314-1f8d7a9ae761/go.mod h1:zVCg+TQX445hh1pC5QgAuuBvvXZMWLY1XYz626dGFqY=
github.com/aler9/rtmp v0.0.0-20210403095203-3be4a5535927 h1:95mXJ5fUCYpBRdSOnLAQAdJHHKxxxJrVCiaqDi965YQ=
github.com/aler9/rtmp v0.0.0-20210403095203-3be4a5535927/go.mod h1:vzuE21rowz+lT1NGsWbreIvYulgBpCGnQyeTyFblUHc=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=

3
internal/clientrtsp/client.go

@ -347,9 +347,8 @@ func (c *Client) run() { @@ -347,9 +347,8 @@ func (c *Client) run() {
Scheme: ctx.Req.URL.Scheme,
User: ctx.Req.URL.User,
Host: ctx.Req.URL.Host,
Path: "/" + c.path.Name(),
Path: "/" + c.path.Name() + "/trackID=" + strconv.FormatInt(int64(trackID), 10),
}
u.AddControlAttribute("trackID=" + strconv.FormatInt(int64(trackID), 10))
clockRate, _ := track.ClockRate()
ts := uint32(uint64(time.Since(ti.NTPTime).Seconds()*float64(clockRate)) +

Loading…
Cancel
Save