From 36b66024adc682e178aa1b3954e8da276fafa0e0 Mon Sep 17 00:00:00 2001 From: Milan Zamazal Date: Tue, 14 Jun 2022 20:03:46 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20err=20in=20pw-lib-default-playb?= =?UTF-8?q?ack-ports=20without=20default=20sink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pw-lib.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pw-lib.el b/pw-lib.el index 75ffcfd..e936761 100644 --- a/pw-lib.el +++ b/pw-lib.el @@ -152,10 +152,11 @@ version, call `pw-lib-refresh' first." (defun pw-lib-default-playback-ports () "Return list of PipeWire objects that are default playback ports." - (cl-remove-if-not #'(lambda (o) - (if-let ((name (pw-lib-object-value o "port.name"))) - (string-match "^playback" name))) - (pw-lib-children (pw-lib-object-id (pw-lib-default-audio-sink)) "Port"))) + (if-let ((sink (pw-lib-default-audio-sink))) + (cl-remove-if-not #'(lambda (o) + (if-let ((name (pw-lib-object-value o "port.name"))) + (string-match "^playback" name))) + (pw-lib-children (pw-lib-object-id sink) "Port")))) (defun pw-lib--volume-% (volume) (when volume