Skip to content

Commit

Permalink
sfos: bluez5: Set transport state to IDLE on transport release.
Browse files Browse the repository at this point in the history
As we are not running the sink or source threads transports
wouldn't get switched to IDLE unless we do so here.

Signed-off-by: Juho Hämäläinen <juho.hamalainen@jolla.com>
  • Loading branch information
jusa committed Feb 24, 2021
1 parent d8d296c commit 3cdbee2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/modules/bluetooth/module-bluez5-device.c
Expand Up @@ -745,6 +745,15 @@ static void transport_release(struct userdata *u) {
* the file descriptor. Only do this when called from the I/O thread */
if (pa_thread_mq_get() != NULL && u->transport->state == PA_BLUETOOTH_TRANSPORT_STATE_PLAYING)
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(u->msg), BLUETOOTH_MESSAGE_STREAM_FD_HUP, NULL, 0, NULL, NULL);

if (pa_bluetooth_droid_backend(u->discovery) &&
u->transport->state > PA_BLUETOOTH_TRANSPORT_STATE_IDLE &&
u->transport->profile != PA_BLUETOOTH_PROFILE_A2DP_SINK &&
u->transport->profile != PA_BLUETOOTH_PROFILE_A2DP_SOURCE) {

pa_log_debug("Set droid HSP/HFP transport to IDLE");
pa_bluetooth_transport_set_state(u->transport, PA_BLUETOOTH_TRANSPORT_STATE_IDLE);
}
}

/* Run from I/O thread */
Expand Down

0 comments on commit 3cdbee2

Please sign in to comment.