File tree Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,7 @@ func NewSession(cfg input.SessionConfig) (*Session, error) {
119119
120120 // pw-cat 1.4.0 introduces explicit stdout support, needs --raw arg
121121 // see https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4629#top
122- useRawArg , err := checkNeedRawArg ()
123- if err != nil {
124- return nil , errors .Wrap (err , "failed to check need of pipewire '--raw' arg" )
125- }
126-
127- if useRawArg {
122+ if checkNeedRawArg () {
128123 args = append (args , "--raw" )
129124 }
130125
@@ -310,22 +305,12 @@ func shortEpoch() string {
310305 return base64 .RawURLEncoding .EncodeToString (buf [:])
311306}
312307
313- func checkNeedRawArg () (bool , error ) {
314- cmd := exec .Command ("pw-cat" , "--help" )
315-
316- out , err := cmd .Output ()
308+ func checkNeedRawArg () bool {
309+ out , err := exec .Command ("pw-cat" , "--help" ).Output ()
317310
318311 if err != nil {
319- return false , err
320- }
321-
322- lines := strings .Split (string (out ), "\n " )
323-
324- for _ , line := range lines {
325- if strings .Contains (line , "--raw" ) {
326- return true , nil
327- }
312+ panic (err )
328313 }
329314
330- return false , nil
315+ return strings . Contains ( string ( out ), "--raw" )
331316}
You can’t perform that action at this time.
0 commit comments