mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
bluetooth: Implement transport release for hf_audio_agent transports
This commit is contained in:
parent
8dd4aa1f00
commit
c4c4de532d
1 changed files with 16 additions and 0 deletions
|
|
@ -188,6 +188,22 @@ static int hf_audio_agent_transport_acquire(pa_bluetooth_transport *t, bool opti
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hf_audio_agent_transport_release(pa_bluetooth_transport *t) {
|
static void hf_audio_agent_transport_release(pa_bluetooth_transport *t) {
|
||||||
|
struct hf_audio_card *card = t->userdata;
|
||||||
|
|
||||||
|
pa_assert(card);
|
||||||
|
|
||||||
|
if (t->state <= PA_BLUETOOTH_TRANSPORT_STATE_IDLE) {
|
||||||
|
pa_log_info("Transport %s already released", t->path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (card->fd < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* shutdown to make sure connection is dropped immediately */
|
||||||
|
shutdown(card->fd, SHUT_RDWR);
|
||||||
|
close(card->fd);
|
||||||
|
card->fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hf_audio_agent_card_found(pa_bluetooth_backend *backend, const char *path, DBusMessageIter *props_i) {
|
static void hf_audio_agent_card_found(pa_bluetooth_backend *backend, const char *path, DBusMessageIter *props_i) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue