From ada39d22cd4cb01ac1dcf35d944a6ecef798418a Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Sat, 27 Sep 2025 13:36:04 +0200 Subject: [PATCH] on Windows, do not look for configuration in linux paths (#5036) --- internal/core/core.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/core/core.go b/internal/core/core.go index 31642013..9c46c67e 100644 --- a/internal/core/core.go +++ b/internal/core/core.go @@ -44,6 +44,9 @@ var version []byte var defaultConfPaths = []string{ "rtsp-simple-server.yml", "mediamtx.yml", +} + +var defaultConfPathsNotWin = []string{ "/usr/local/etc/mediamtx.yml", "/usr/etc/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}, "", "") - 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 { fmt.Printf("ERR: %s\n", err) return nil, false