mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
bluetooth: Remove pa_bluetooth_discovery_sync().
pa_bluetooth_discovery_sync() waited until all pending method calls had completed. I don't understand what the benefit of that could be, so I removed the function. We should avoid blocking as much as possible, and the code that used pa_bluetooth_discovery_sync() didn't look like it really needed to wait for anything.
This commit is contained in:
parent
de73a3ed98
commit
baa62fb615
3 changed files with 4 additions and 26 deletions
|
|
@ -1049,9 +1049,6 @@ pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discover
|
|||
pa_assert(PA_REFCNT_VALUE(y) > 0);
|
||||
pa_assert(address);
|
||||
|
||||
if (!pa_hook_is_firing(&y->hooks[PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED]))
|
||||
pa_bluetooth_discovery_sync(y);
|
||||
|
||||
while ((d = pa_hashmap_iterate(y->devices, &state, NULL)))
|
||||
if (pa_streq(d->address, address))
|
||||
return device_is_audio_ready(d) ? d : NULL;
|
||||
|
|
@ -1066,9 +1063,6 @@ pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *
|
|||
pa_assert(PA_REFCNT_VALUE(y) > 0);
|
||||
pa_assert(path);
|
||||
|
||||
if (!pa_hook_is_firing(&y->hooks[PA_BLUETOOTH_HOOK_DEVICE_CONNECTION_CHANGED]))
|
||||
pa_bluetooth_discovery_sync(y);
|
||||
|
||||
if ((d = pa_hashmap_get(y->devices, path)))
|
||||
if (device_is_audio_ready(d))
|
||||
return d;
|
||||
|
|
@ -1764,13 +1758,6 @@ void pa_bluetooth_discovery_unref(pa_bluetooth_discovery *y) {
|
|||
pa_xfree(y);
|
||||
}
|
||||
|
||||
void pa_bluetooth_discovery_sync(pa_bluetooth_discovery *y) {
|
||||
pa_assert(y);
|
||||
pa_assert(PA_REFCNT_VALUE(y) > 0);
|
||||
|
||||
pa_dbus_sync_pending_list(&y->pending);
|
||||
}
|
||||
|
||||
pa_hook* pa_bluetooth_discovery_hook(pa_bluetooth_discovery *y, pa_bluetooth_hook_t hook) {
|
||||
pa_assert(y);
|
||||
pa_assert(PA_REFCNT_VALUE(y) > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue