Skip to content

Commit

Permalink
sfos: bluez5: Use volume control in native backend.
Browse files Browse the repository at this point in the history
Signed-off-by: Juho Hämäläinen <juho.hamalainen@jolla.com>
  • Loading branch information
jusa committed Feb 24, 2021
1 parent f1ad680 commit a6de847
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/bluetooth/backend-native.c
Expand Up @@ -212,13 +212,17 @@ static int sco_acquire_cb(pa_bluetooth_transport *t, bool optional, size_t *imtu
}
}

pa_bluetooth_droid_volume_control_acquire(t->device->discovery, t);

return sock;

fail:
return -1;
}

static void sco_release_cb(pa_bluetooth_transport *t) {
pa_bluetooth_droid_volume_control_release(t->device->discovery);

pa_log_info("Transport %s released", t->path);
/* device will close the SCO socket for us */
}
Expand Down Expand Up @@ -423,6 +427,8 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
static void transport_destroy(pa_bluetooth_transport *t) {
struct transport_data *trd = t->userdata;

pa_bluetooth_droid_volume_control_release(t->device->discovery);

if (trd->sco_io) {
trd->mainloop->io_free(trd->sco_io);
shutdown(trd->sco_fd, SHUT_RDWR);
Expand Down

0 comments on commit a6de847

Please sign in to comment.