mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-17 08:56:42 -05:00
reserve: update reserve.[ch] from upstream git
This commit is contained in:
parent
3e10f3f4e3
commit
1748fd2a0d
2 changed files with 9 additions and 15 deletions
|
|
@ -43,16 +43,15 @@ struct rd_device {
|
||||||
|
|
||||||
DBusConnection *connection;
|
DBusConnection *connection;
|
||||||
|
|
||||||
int owning:1;
|
unsigned owning:1;
|
||||||
int registered:1;
|
unsigned registered:1;
|
||||||
int filtering:1;
|
unsigned filtering:1;
|
||||||
int gave_up:1;
|
unsigned gave_up:1;
|
||||||
|
|
||||||
rd_request_cb_t request_cb;
|
rd_request_cb_t request_cb;
|
||||||
void *userdata;
|
void *userdata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define SERVICE_PREFIX "org.freedesktop.ReserveDevice1."
|
#define SERVICE_PREFIX "org.freedesktop.ReserveDevice1."
|
||||||
#define OBJECT_PREFIX "/org/freedesktop/ReserveDevice1/"
|
#define OBJECT_PREFIX "/org/freedesktop/ReserveDevice1/"
|
||||||
|
|
||||||
|
|
@ -297,6 +296,7 @@ static DBusHandlerResult filter_handler(
|
||||||
dbus_error_init(&error);
|
dbus_error_init(&error);
|
||||||
|
|
||||||
d = userdata;
|
d = userdata;
|
||||||
|
assert(d->ref >= 1);
|
||||||
|
|
||||||
if (dbus_message_is_signal(m, "org.freedesktop.DBus", "NameLost")) {
|
if (dbus_message_is_signal(m, "org.freedesktop.DBus", "NameLost")) {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
@ -560,7 +560,7 @@ void rd_release(
|
||||||
|
|
||||||
assert(d->ref > 0);
|
assert(d->ref > 0);
|
||||||
|
|
||||||
if (--d->ref)
|
if (--d->ref > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -575,17 +575,11 @@ void rd_release(
|
||||||
d->connection,
|
d->connection,
|
||||||
d->object_path);
|
d->object_path);
|
||||||
|
|
||||||
if (d->owning) {
|
if (d->owning)
|
||||||
DBusError error;
|
|
||||||
dbus_error_init(&error);
|
|
||||||
|
|
||||||
dbus_bus_release_name(
|
dbus_bus_release_name(
|
||||||
d->connection,
|
d->connection,
|
||||||
d->service_name,
|
d->service_name,
|
||||||
&error);
|
NULL);
|
||||||
|
|
||||||
dbus_error_free(&error);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(d->device_name);
|
free(d->device_name);
|
||||||
free(d->application_name);
|
free(d->application_name);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ typedef int (*rd_request_cb_t)(
|
||||||
* the error was caused D-Bus. */
|
* the error was caused D-Bus. */
|
||||||
int rd_acquire(
|
int rd_acquire(
|
||||||
rd_device **d, /* On success a pointer to the newly allocated rd_device object will be filled in here */
|
rd_device **d, /* On success a pointer to the newly allocated rd_device object will be filled in here */
|
||||||
DBusConnection *connection,
|
DBusConnection *connection, /* Session bus (when D-Bus learns about user busses we should switchg to user busses) */
|
||||||
const char *device_name, /* The device to lock, e.g. "Audio0" */
|
const char *device_name, /* The device to lock, e.g. "Audio0" */
|
||||||
const char *application_name, /* A human readable name of the application, e.g. "PulseAudio Sound Server" */
|
const char *application_name, /* A human readable name of the application, e.g. "PulseAudio Sound Server" */
|
||||||
int32_t priority, /* The priority for this application. If unsure use 0 */
|
int32_t priority, /* The priority for this application. If unsure use 0 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue