Skip to content

Fix several instances of PulseAudio API misuse#103

Open
kinetiknz wants to merge 5 commits intodevfrom
fix-pulse-api-misuse
Open

Fix several instances of PulseAudio API misuse#103
kinetiknz wants to merge 5 commits intodevfrom
fix-pulse-api-misuse

Conversation

@kinetiknz
Copy link
Copy Markdown
Contributor

@kinetiknz kinetiknz commented Mar 17, 2026

  • Make sure we hold the mainloop lock when accessing PA objects that require the lock held
  • Handle get_sink_info_by_name failure to avoid potential deadlock on startup with misconfigured PA servers
  • Fix Device/ffi::cubeb_device mismatch between current_device/device_destroy, also handles a string leak on the error path
  • Introduce MainloopLockGuard

@kinetiknz kinetiknz requested review from Pehrsons and padenot March 17, 2026 05:30
@kinetiknz kinetiknz self-assigned this Mar 17, 2026
Copy link
Copy Markdown
Collaborator

@padenot padenot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question on the locks, the rest looks fine.

@kinetiknz kinetiknz requested a review from padenot March 17, 2026 21:30
@kinetiknz kinetiknz force-pushed the fix-pulse-api-misuse branch from 05ac9fc to a15b5d8 Compare March 17, 2026 22:12
stm.context.mainloop.unlock();

if !r {
drop(mainloop_lock.take());
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also fixes the case where we unlocked the mainloop lock too early if we entered the log_enabled() path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants