From 62a4e36f5d136211599a02eff648d6ca2045d539 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 24 Mar 2009 14:07:51 +0200 Subject: bluetooth: connected can be -1, check > 0 --- src/modules/bluetooth/module-bluetooth-discover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/bluetooth/module-bluetooth-discover.c') diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c index 3288cc55..49c7a800 100644 --- a/src/modules/bluetooth/module-bluetooth-discover.c +++ b/src/modules/bluetooth/module-bluetooth-discover.c @@ -93,7 +93,7 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const /* Oh, awesome, a new device has shown up and been connected! */ - args = pa_sprintf_malloc("address=\"%s\" path=\"%s\" profile=\"%s\"", d->address, d->path, d->headset_connected ? "hsp" : "a2dp"); + args = pa_sprintf_malloc("address=\"%s\" path=\"%s\" profile=\"%s\"", d->address, d->path, d->headset_connected > 0 ? "hsp" : "a2dp"); #ifdef NOKIA if (pa_modargs_get_value(u->modargs, "sco_sink", NULL) && -- cgit From 87fcb3d5925cc030e957f55399f8c3e96c66cbb5 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Fri, 27 Mar 2009 21:48:04 +0200 Subject: bluetooth: use new audio State properties --- src/modules/bluetooth/module-bluetooth-discover.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/modules/bluetooth/module-bluetooth-discover.c') diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c index 49c7a800..6f3dba12 100644 --- a/src/modules/bluetooth/module-bluetooth-discover.c +++ b/src/modules/bluetooth/module-bluetooth-discover.c @@ -84,8 +84,7 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const mi = pa_hashmap_get(u->hashmap, d->path); if (!d->dead && - d->device_connected > 0 && - (d->audio_sink_connected > 0 || d->headset_connected > 0)) { + d->device_connected > 0 && d->audio_state >= PA_BT_AUDIO_STATE_CONNECTED) { if (!mi) { pa_module *m = NULL; @@ -93,7 +92,16 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const /* Oh, awesome, a new device has shown up and been connected! */ - args = pa_sprintf_malloc("address=\"%s\" path=\"%s\" profile=\"%s\"", d->address, d->path, d->headset_connected > 0 ? "hsp" : "a2dp"); + args = pa_sprintf_malloc("address=\"%s\" path=\"%s\"", d->address, d->path); +#if 0 + /* This is in case we have to use hsp immediately, without waiting for .Audio.State = Connected */ + if (d->headset_state >= PA_BT_AUDIO_STATE_CONNECTED && somecondition) { + char *tmp; + tmp = pa_sprintf_malloc("%s profile=\"hsp\"", args); + pa_xfree(args); + args = tmp; + } +#endif #ifdef NOKIA if (pa_modargs_get_value(u->modargs, "sco_sink", NULL) && -- cgit