mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 20:41:59 -08:00
remove streamDeadAfter
This commit is contained in:
parent
da5e001206
commit
857fbccdea
4 changed files with 3 additions and 9 deletions
4
conf.go
4
conf.go
|
|
@ -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) {
|
|||
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"}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
|||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue