Browse Source

remove streamDeadAfter

pull/52/head
aler9 6 years ago
parent
commit
857fbccdea
  1. 4
      conf.go
  2. 2
      rtsp-simple-server.yml
  3. 4
      server-client.go
  4. 2
      source.go

4
conf.go

@ -35,7 +35,6 @@ type conf struct { @@ -35,7 +35,6 @@ type conf struct {
RunOnConnect string `yaml:"runOnConnect"`
ReadTimeout time.Duration `yaml:"readTimeout"`
WriteTimeout time.Duration `yaml:"writeTimeout"`
StreamDeadAfter time.Duration `yaml:"streamDeadAfter"`
AuthMethods []string `yaml:"authMethods"`
authMethodsParsed []gortsplib.AuthMethod
Pprof bool `yaml:"pprof"`
@ -122,9 +121,6 @@ func loadConf(fpath string, stdin io.Reader) (*conf, error) { @@ -122,9 +121,6 @@ func loadConf(fpath string, stdin io.Reader) (*conf, error) {
if conf.WriteTimeout == 0 {
conf.WriteTimeout = 5 * time.Second
}
if conf.StreamDeadAfter == 0 {
conf.StreamDeadAfter = 15 * time.Second
}
if len(conf.AuthMethods) == 0 {
conf.AuthMethods = []string{"basic", "digest"}

2
rtsp-simple-server.yml

@ -14,8 +14,6 @@ runOnConnect: @@ -14,8 +14,6 @@ runOnConnect:
readTimeout: 5s
# timeout of write operations
writeTimeout: 5s
# time after which a stream is considered dead
streamDeadAfter: 15s
# supported authentication methods
authMethods: [basic, digest]
# enable pprof on port 9999 to monitor performance

4
server-client.go

@ -966,7 +966,7 @@ func (c *serverClient) runRecord(path string) { @@ -966,7 +966,7 @@ func (c *serverClient) runRecord(path string) {
case <-checkStreamTicker.C:
for trackId := range c.streamTracks {
if time.Since(c.rtcpReceivers[trackId].LastFrameTime()) >= c.p.conf.StreamDeadAfter {
if time.Since(c.rtcpReceivers[trackId].LastFrameTime()) >= c.p.conf.ReadTimeout {
c.log("ERR: stream is dead")
c.conn.NetConn().Close()
<-readDone
@ -1021,7 +1021,7 @@ func (c *serverClient) runRecord(path string) { @@ -1021,7 +1021,7 @@ func (c *serverClient) runRecord(path string) {
case <-checkStreamTicker.C:
for trackId := range c.streamTracks {
if time.Since(c.rtcpReceivers[trackId].LastFrameTime()) >= c.p.conf.StreamDeadAfter {
if time.Since(c.rtcpReceivers[trackId].LastFrameTime()) >= c.p.conf.ReadTimeout {
c.log("ERR: stream is dead")
c.conn.NetConn().Close()
<-readDone

2
source.go

@ -276,7 +276,7 @@ outer: @@ -276,7 +276,7 @@ outer:
case <-checkStreamTicker.C:
for trackId := range s.tracks {
if time.Since(s.rtcpReceivers[trackId].LastFrameTime()) >= s.p.conf.StreamDeadAfter {
if time.Since(s.rtcpReceivers[trackId].LastFrameTime()) >= s.p.conf.ReadTimeout {
s.log("ERR: stream is dead")
ret = true
break outer

Loading…
Cancel
Save