From eb6d142bfa8e6e8321507388ca93137b883573aa Mon Sep 17 00:00:00 2001 From: noriah Date: Sat, 25 Mar 2023 14:56:42 -0700 Subject: [PATCH] fix type --- input/backend.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/input/backend.go b/input/backend.go index 3bbcb69..a02dbae 100644 --- a/input/backend.go +++ b/input/backend.go @@ -43,7 +43,7 @@ func GetAllBackendNames() []string { return out } -// Get the default backend depending on +// Get the default backend depending on runtime.GOOS func DefaultBackend() string { switch runtime.GOOS { case "windows": @@ -52,10 +52,8 @@ func DefaultBackend() string { } case "darwin": - if backend := FindBackend("portaudio"); backend != nil { - if HasBackend("portaudio") { - return "portaudio" - } + if HasBackend("portaudio") { + return "portaudio" } if HasBackend("ffmpeg-avfoundation") { @@ -63,14 +61,14 @@ func DefaultBackend() string { } case "linux": - if path, _ := exec.LookPath("pw-cat"); path != "" { - if HasBackend("pipewire") { + if HasBackend("pipewire") { + if path, _ := exec.LookPath("pw-cat"); path != "" { return "pipewire" } } - if path, _ := exec.LookPath("parec"); path != "" { - if HasBackend("parec") { + if HasBackend("parec") { + if path, _ := exec.LookPath("parec"); path != "" { return "parec" } }