mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-04 03:03:00 -04:00
module-rt: Use a sane timeout for DBus messages
The default of 30s (* 3 for the 3 lookups), makes the mainloop block for a very long time if anything is wrong with RTKit.
This commit is contained in:
parent
7303a55b50
commit
aef3d02173
1 changed files with 4 additions and 2 deletions
|
|
@ -185,6 +185,8 @@ static const struct spa_dict_item module_props[] = {
|
|||
#define XDG_PORTAL_OBJECT_PATH "/org/freedesktop/portal/desktop"
|
||||
#define XDG_PORTAL_INTERFACE "org.freedesktop.portal.Realtime"
|
||||
|
||||
#define DBUS_TIMEOUT_MSEC 2000 /* max time to block on any single message */
|
||||
|
||||
/** \cond */
|
||||
struct pw_rtkit_bus {
|
||||
DBusConnection *bus;
|
||||
|
|
@ -370,7 +372,7 @@ static long long rtkit_get_int_property(struct impl *impl, const char *propname,
|
|||
|
||||
spa_auto(DBusError) error = DBUS_ERROR_INIT;
|
||||
|
||||
if (!(r = dbus_connection_send_with_reply_and_block(connection->bus, m, -1, &error)))
|
||||
if (!(r = dbus_connection_send_with_reply_and_block(connection->bus, m, DBUS_TIMEOUT_MSEC, &error)))
|
||||
return translate_error(error.name);
|
||||
|
||||
if (dbus_set_error_from_message(&error, r))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue