|
|
|
@ -24,6 +24,7 @@ type PathConf struct { |
|
|
|
SourceOnDemandStartTimeout time.Duration `yaml:"sourceOnDemandStartTimeout"` |
|
|
|
SourceOnDemandStartTimeout time.Duration `yaml:"sourceOnDemandStartTimeout"` |
|
|
|
SourceOnDemandCloseAfter time.Duration `yaml:"sourceOnDemandCloseAfter"` |
|
|
|
SourceOnDemandCloseAfter time.Duration `yaml:"sourceOnDemandCloseAfter"` |
|
|
|
SourceRedirect string `yaml:"sourceRedirect"` |
|
|
|
SourceRedirect string `yaml:"sourceRedirect"` |
|
|
|
|
|
|
|
Fallback string `yaml:"fallback"` |
|
|
|
RunOnInit string `yaml:"runOnInit"` |
|
|
|
RunOnInit string `yaml:"runOnInit"` |
|
|
|
RunOnInitRestart bool `yaml:"runOnInitRestart"` |
|
|
|
RunOnInitRestart bool `yaml:"runOnInitRestart"` |
|
|
|
RunOnDemand string `yaml:"runOnDemand"` |
|
|
|
RunOnDemand string `yaml:"runOnDemand"` |
|
|
|
@ -150,6 +151,17 @@ func (pconf *PathConf) fillAndCheck(name string) error { |
|
|
|
pconf.SourceOnDemandCloseAfter = 10 * time.Second |
|
|
|
pconf.SourceOnDemandCloseAfter = 10 * time.Second |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pconf.Fallback != "" { |
|
|
|
|
|
|
|
u, err := url.Parse(pconf.Fallback) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return fmt.Errorf("'%s' is not a valid rtsp url", pconf.Fallback) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if u.Scheme != "rtsp" { |
|
|
|
|
|
|
|
return fmt.Errorf("'%s' is not a valid rtsp url", pconf.Fallback) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if pconf.PublishUser != "" { |
|
|
|
if pconf.PublishUser != "" { |
|
|
|
if !reUserPass.MatchString(pconf.PublishUser) { |
|
|
|
if !reUserPass.MatchString(pconf.PublishUser) { |
|
|
|
return fmt.Errorf("publish username contains unsupported characters (supported are %s)", userPassSupportedChars) |
|
|
|
return fmt.Errorf("publish username contains unsupported characters (supported are %s)", userPassSupportedChars) |
|
|
|
|