bluetooth: Update to new BlueZ 5 transport acquire/release API

The new D-Bus API doesn't support access rights, which weren't used by
PulseAudio anyway, but it does solve a race condition: now optional
acquires can be implemented by bluetooth-util atomically using the D-Bus
TryAcquire() method.
This commit is contained in:
Mikel Astiz 2013-05-10 10:30:46 +02:00 committed by Arun Raghavan
parent 6fdf2b05b8
commit 9615def4b9
2 changed files with 43 additions and 33 deletions

View file

@ -368,14 +368,8 @@ static int bt_transport_acquire(struct userdata *u, bool optional) {
pa_log_debug("Acquiring transport %s", u->transport->path);
u->stream_fd = pa_bluetooth_transport_acquire(u->transport, optional, &u->read_link_mtu, &u->write_link_mtu);
if (u->stream_fd < 0) {
if (!optional)
pa_log("Failed to acquire transport %s", u->transport->path);
else
pa_log_info("Failed optional acquire of transport %s", u->transport->path);
if (u->stream_fd < 0)
return -1;
}
u->transport_acquired = true;
pa_log_info("Transport %s acquired: fd %d", u->transport->path, u->stream_fd);