mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
rtkit: use private bus connection in order to avoid threading issues when invoking pa_make_realtime()
This commit is contained in:
parent
320b70e94e
commit
8eed569614
1 changed files with 2 additions and 1 deletions
|
|
@ -661,7 +661,7 @@ static int set_scheduler(int rtprio) {
|
||||||
#ifdef HAVE_DBUS
|
#ifdef HAVE_DBUS
|
||||||
/* Try to talk to RealtimeKit */
|
/* Try to talk to RealtimeKit */
|
||||||
|
|
||||||
if (!(bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error))) {
|
if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) {
|
||||||
pa_log("Failed to connect to system bus: %s\n", error.message);
|
pa_log("Failed to connect to system bus: %s\n", error.message);
|
||||||
dbus_error_free(&error);
|
dbus_error_free(&error);
|
||||||
errno = -EIO;
|
errno = -EIO;
|
||||||
|
|
@ -674,6 +674,7 @@ static int set_scheduler(int rtprio) {
|
||||||
dbus_connection_set_exit_on_disconnect(bus, FALSE);
|
dbus_connection_set_exit_on_disconnect(bus, FALSE);
|
||||||
|
|
||||||
r = rtkit_make_realtime(bus, 0, rtprio);
|
r = rtkit_make_realtime(bus, 0, rtprio);
|
||||||
|
dbus_connection_close(bus);
|
||||||
dbus_connection_unref(bus);
|
dbus_connection_unref(bus);
|
||||||
|
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue