Try to fix inhibit-sleep-for-audio.lisp for discord

This commit is contained in:
2025-11-07 22:46:58 -08:00
parent e0dad7f7dd
commit a3aba45b6e

View File

@ -20,13 +20,13 @@
(defun event-stream-states (event) (defun event-stream-states (event)
"Return a alist mapping ids to stream states." "Return a alist mapping ids to stream states."
(loop for obj across event (loop for obj across event
for info = (gethash "info" obj)
for id = (gethash "id" obj) for id = (gethash "id" obj)
for running = (and (hash-table-p info) for info = (gethash "info" obj)
for props = (and (hash-table-p info) (gethash "props" info))
for running = (and (hash-table-p props)
(equal (gethash "type" obj) "PipeWire:Interface:Node") (equal (gethash "type" obj) "PipeWire:Interface:Node")
(equal (gethash "state" info) "running") (equal (gethash "state" info) "running")
(or (not (equal (gethash "n-input-ports" info) 0)) (gethash "stream.is-live" props))
(not (equal (gethash "n-output-ports" info) 0))))
collect (cons id running))) collect (cons id running)))
(defvar *inhibitor-process* nil (defvar *inhibitor-process* nil