mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
on Windows, do not look for configuration in linux paths (#5036)
Some checks failed
code_lint / go (push) Has been cancelled
code_lint / go_mod (push) Has been cancelled
code_lint / docs (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled
Some checks failed
code_lint / go (push) Has been cancelled
code_lint / go_mod (push) Has been cancelled
code_lint / docs (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled
This commit is contained in:
parent
8e6cc4fab4
commit
ada39d22cd
1 changed files with 9 additions and 1 deletions
|
|
@ -44,6 +44,9 @@ var version []byte
|
||||||
var defaultConfPaths = []string{
|
var defaultConfPaths = []string{
|
||||||
"rtsp-simple-server.yml",
|
"rtsp-simple-server.yml",
|
||||||
"mediamtx.yml",
|
"mediamtx.yml",
|
||||||
|
}
|
||||||
|
|
||||||
|
var defaultConfPathsNotWin = []string{
|
||||||
"/usr/local/etc/mediamtx.yml",
|
"/usr/local/etc/mediamtx.yml",
|
||||||
"/usr/etc/mediamtx.yml",
|
"/usr/etc/mediamtx.yml",
|
||||||
"/etc/mediamtx/mediamtx.yml",
|
"/etc/mediamtx/mediamtx.yml",
|
||||||
|
|
@ -143,7 +146,12 @@ func New(args []string) (*Core, bool) {
|
||||||
|
|
||||||
tempLogger, _ := logger.New(logger.Warn, []logger.Destination{logger.DestinationStdout}, "", "")
|
tempLogger, _ := logger.New(logger.Warn, []logger.Destination{logger.DestinationStdout}, "", "")
|
||||||
|
|
||||||
p.conf, p.confPath, err = conf.Load(cli.Confpath, defaultConfPaths, tempLogger)
|
confPaths := append([]string(nil), defaultConfPaths...)
|
||||||
|
if runtime.GOOS != "windows" {
|
||||||
|
confPaths = append(confPaths, defaultConfPathsNotWin...)
|
||||||
|
}
|
||||||
|
|
||||||
|
p.conf, p.confPath, err = conf.Load(cli.Confpath, confPaths, tempLogger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("ERR: %s\n", err)
|
fmt.Printf("ERR: %s\n", err)
|
||||||
return nil, false
|
return nil, false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue