mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
Don't need to explicity check if hcid is running anymore
This commit is contained in:
parent
2b68562323
commit
9907b461d4
1 changed files with 4 additions and 17 deletions
|
|
@ -235,6 +235,8 @@ static void detect_adapters(struct userdata *u) {
|
|||
goto fail;
|
||||
}
|
||||
dbus_message_iter_recurse(&arg_i, &element_i);
|
||||
// TODO: Review error checking
|
||||
// should this be changed to while (dbus_message_iter_get_arg_type(&element_i) == DBUS_TYPE_OBJECT_PATH) ?
|
||||
while (dbus_message_iter_get_arg_type(&element_i) != DBUS_TYPE_INVALID) {
|
||||
if (dbus_message_iter_get_arg_type(&element_i) == DBUS_TYPE_OBJECT_PATH) {
|
||||
dbus_message_iter_get_basic(&element_i, &value);
|
||||
|
|
@ -318,6 +320,8 @@ static void detect_devices(struct userdata *u) {
|
|||
goto fail;
|
||||
}
|
||||
dbus_message_iter_recurse(&arg_i, &element_i);
|
||||
// TODO: Review error checking
|
||||
// should this be changed to while (dbus_message_iter_get_arg_type(&element_i) == DBUS_TYPE_OBJECT_PATH) ?
|
||||
while (dbus_message_iter_get_arg_type(&element_i) != DBUS_TYPE_INVALID) {
|
||||
if (dbus_message_iter_get_arg_type(&element_i) == DBUS_TYPE_OBJECT_PATH) {
|
||||
dbus_message_iter_get_basic(&element_i, &value);
|
||||
|
|
@ -523,7 +527,6 @@ int pa__init(pa_module* m) {
|
|||
adapter_t *adapter_list_i;
|
||||
device_t *device_list_i;
|
||||
const char *value;
|
||||
unsigned int hcid_running = 0;
|
||||
struct userdata *u;
|
||||
|
||||
pa_assert(m);
|
||||
|
|
@ -539,22 +542,6 @@ int pa__init(pa_module* m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* check if hcid is running */
|
||||
arg_i = call_dbus_method(u->conn, "org.freedesktop.DBus", "/org/freedesktop/DBus" , "org.freedesktop.DBus", "ListNames");
|
||||
dbus_message_iter_recurse(&arg_i, &element_i);
|
||||
while (dbus_message_iter_get_arg_type(&element_i) != DBUS_TYPE_INVALID) {
|
||||
if (dbus_message_iter_get_arg_type(&element_i) == DBUS_TYPE_STRING) {
|
||||
dbus_message_iter_get_basic(&element_i, &value);
|
||||
if (strcmp(value, "org.bluez") == 0)
|
||||
hcid_running = 1;
|
||||
}
|
||||
dbus_message_iter_next(&element_i);
|
||||
}
|
||||
if (!hcid_running) {
|
||||
pa_log("hcid not running");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* static detection of bluetooth audio devices */
|
||||
u->adapter_list = adapter_new("/ADAPTER_HEAD");
|
||||
detect_adapters(u);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue