From fa736887f4da324fd8d34003ff0336430aa251ec Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 25 Feb 2009 14:31:29 +0200 Subject: bluetooth: hsp case, check l for appropriate error message --- src/modules/bluetooth/module-bluetooth-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 72cf2084..39a4a3b3 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -921,7 +921,7 @@ static int hsp_process_push(struct userdata *u) { if (l < 0 && errno == EINTR) continue; else { - pa_log_error("Failed to read data from SCO socket: %s", ret < 0 ? pa_cstrerror(errno) : "EOF"); + pa_log_error("Failed to read data from SCO socket: %s", l < 0 ? pa_cstrerror(errno) : "EOF"); ret = -1; break; } -- cgit From 683548e8bce8079b0ac432dce13e13c2ac9f9d98 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Fri, 27 Feb 2009 00:13:54 +0200 Subject: bluetooth: service_fd could be 0 --- src/modules/bluetooth/module-bluetooth-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 39a4a3b3..7c234ec8 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -1363,7 +1363,7 @@ static void sco_over_pcm_state_update(struct userdata *u) { if (PA_SINK_IS_OPENED(pa_sink_get_state(u->hsp.sco_sink)) || PA_SOURCE_IS_OPENED(pa_source_get_state(u->hsp.sco_source))) { - if (u->service_fd > 0) + if (u->service_fd >= 0) return; pa_log_debug("Resuming SCO over PCM"); @@ -1372,7 +1372,7 @@ static void sco_over_pcm_state_update(struct userdata *u) { } else { - if (u->service_fd <= 0) + if (u->service_fd < 0) return; pa_log_debug("Closing SCO over PCM"); -- cgit From 7a8be7f91e775f48cb1020e8f7a2ea39db07ad69 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 4 Mar 2009 16:38:02 +0200 Subject: bluetooth: don't init profile when off --- src/modules/bluetooth/module-bluetooth-device.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 7c234ec8..495bc82f 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -1559,6 +1559,7 @@ static int setup_bt(struct userdata *u) { static int init_profile(struct userdata *u) { int r = 0; pa_assert(u); + pa_assert(u->profile != PROFILE_OFF); if (setup_bt(u) < 0) return -1; @@ -1688,7 +1689,9 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) { u->sample_spec = u->requested_sample_spec; init_bt(u); - init_profile(u); + + if (u->profile != PROFILE_OFF) + init_profile(u); if (u->sink || u->source) start_thread(u); @@ -1909,8 +1912,9 @@ int pa__init(pa_module* m) { if (init_bt(u) < 0) goto fail; - if (init_profile(u) < 0) - goto fail; + if (u->profile != PROFILE_OFF) + if (init_profile(u) < 0) + goto fail; /* if (u->path) { */ /* DBusError err; */ @@ -1948,8 +1952,9 @@ int pa__init(pa_module* m) { /* } */ /* } */ - if (start_thread(u) < 0) - goto fail; + if (u->sink || u->source) + if (start_thread(u) < 0) + goto fail; return 0; -- cgit