1 From 39f578d2c44fef9fd2e105eb7594a2d249152e63 Mon Sep 17 00:00:00 2001
2 From: Thierry Bultel <thierry.bultel@iot.bzh>
3 Date: Mon, 10 Sep 2018 14:56:14 +0200
4 Subject: [PATCH] proxy plugin: close transport when null device is set
6 Simply closes the transport when bluealsa_proxy_set_remote_device
7 specifies a null device.
8 Also removed spurious log.
10 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
12 src/asound/bluealsa-pcm-proxy.c | 11 +++++++++--
13 1 file changed, 9 insertions(+), 2 deletions(-)
15 diff --git a/src/asound/bluealsa-pcm-proxy.c b/src/asound/bluealsa-pcm-proxy.c
16 index 4abab2b..7c59cd1 100644
17 --- a/src/asound/bluealsa-pcm-proxy.c
18 +++ b/src/asound/bluealsa-pcm-proxy.c
19 @@ -130,7 +130,7 @@ static void *io_thread(void *arg) {
23 - debug("PLUGIN io-thread: wait for pcm_fd\n");
24 + //debug("PLUGIN io-thread: wait for pcm_fd\n");
26 /* In the capture mode, the PCM FIFO is opened in the non-blocking mode.
27 * So right now, we have to synchronize write and read sides, otherwise
28 @@ -784,7 +784,14 @@ int bluealsa_proxy_set_remote_device(const char * interface, const char * device
32 - if (device == NULL || str2ba(device, &the_pcm->addr) != 0) {
33 + /* When the hardware address is NULL, just close the connection */
34 + if (device == NULL ) {
35 + close_bluez_connection();
40 + if ( str2ba(device, &the_pcm->addr) != 0) {
41 SNDERR("Invalid BT device address: %s", device);