From f99baee6e0f4a07044873d8cadbf99b6c1f5741a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Fri, 8 Dec 2023 17:44:22 +0100 Subject: [PATCH] fix: Windows path for included ffmpeg --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 87df1a0..54a5321 100644 --- a/main.go +++ b/main.go @@ -45,6 +45,7 @@ import ( "net/url" "os" "os/exec" + "path/filepath" "runtime" "strings" "time" @@ -297,7 +298,12 @@ func main() { if runtime.GOOS == "windows" { log.Println("Detected Windows") - PLAYER_CMD = "ffmpeg.exe" + ex, err := os.Executable() + if err != nil { + log.Fatal("Couldn't get executable path") + } + exPath := filepath.Dir(ex) + PLAYER_CMD = filepath.Join(exPath, "ffmpeg.exe") } // Command line arguments parsing