[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test2-4-g87e1342
Lennart Poettering
gitmailer-noreply at 0pointer.de
Thu Feb 12 13:09:28 PST 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from d9e3abaf83ab2cf28ff6929495880cde0d9a933b (commit)
- Log -----------------------------------------------------------------
87e1342... don't claim that profile changes are always successful
52bfd47... use the same service fd shutdown logic when destructing module and changing profile
b18c875... minor service IO fixes
-----------------------------------------------------------------------
Summary of changes:
src/modules/bluetooth/module-bluetooth-device.c | 33 +++++++++++------------
src/pulsecore/card.c | 2 +-
2 files changed, 17 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
commit b18c8755d6de107486ebb305d0bb2909278bf29b
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Feb 12 22:06:15 2009 +0100
minor service IO fixes
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 294fc66..9414eee 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -162,20 +162,18 @@ static int init_bt(struct userdata *u);
static int init_profile(struct userdata *u);
static int service_send(struct userdata *u, const bt_audio_msg_header_t *msg) {
- size_t length;
ssize_t r;
pa_assert(u);
pa_assert(u->service_fd >= 0);
pa_assert(msg);
-
- length = msg->length ? msg->length : BT_SUGGESTED_BUFFER_SIZE;
+ pa_assert(msg->length > 0);
pa_log_debug("Sending %s -> %s",
pa_strnull(bt_audio_strtype(msg->type)),
pa_strnull(bt_audio_strname(msg->name)));
- if ((r = pa_loop_write(u->service_fd, msg, length, &u->service_write_type)) == (ssize_t) length)
+ if ((r = pa_loop_write(u->service_fd, msg, msg->length, &u->service_write_type)) == (ssize_t) msg->length)
return 0;
if (r < 0)
@@ -207,7 +205,7 @@ static int service_recv(struct userdata *u, bt_audio_msg_header_t *msg, size_t r
return -1;
}
- /* Second, read the payload */
+ /* Secondly, read the payload */
if (msg->length > sizeof(*msg)) {
size_t remains = msg->length - sizeof(*msg);
@@ -217,7 +215,6 @@ static int service_recv(struct userdata *u, bt_audio_msg_header_t *msg, size_t r
remains,
&u->service_read_type)) != (ssize_t) remains)
goto read_fail;
-
}
pa_log_debug("Received %s <- %s",
@@ -231,7 +228,7 @@ read_fail:
if (r < 0)
pa_log_error("Error receiving data from audio service: %s", pa_cstrerror(errno));
else
- pa_log_error("Short recv()");
+ pa_log_error("Short read()");
return -1;
}
commit 52bfd47a493d927b4dac3c725454d2e7d4f8ca05
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Feb 12 22:09:00 2009 +0100
use the same service fd shutdown logic when destructing module and changing profile
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 9414eee..3498088 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1412,10 +1412,9 @@ static int add_source(struct userdata *u) {
return 0;
}
-static int init_bt(struct userdata *u) {
+static void shutdown_bt(struct userdata *u) {
pa_assert(u);
- /* shutdown bt */
if (u->stream_fd >= 0) {
pa_close(u->stream_fd);
u->stream_fd = -1;
@@ -1425,15 +1424,21 @@ static int init_bt(struct userdata *u) {
pa_close(u->service_fd);
u->service_fd = -1;
}
+}
+
+static int init_bt(struct userdata *u) {
+ pa_assert(u);
+
+ shutdown_bt(u);
u->stream_write_type = u->stream_read_type = 0;
- u->service_write_type = u->stream_write_type = 0;
+ u->service_write_type = u->service_write_type = 0;
- /* connect to the bluez audio service */
if ((u->service_fd = bt_audio_service_open()) < 0) {
pa_log_error("Couldn't connect to bluetooth audio service");
return -1;
}
+
pa_log_debug("Connected to the bluetooth audio service");
return 0;
@@ -1576,7 +1581,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
}
stop_thread(u);
- init_bt(u);
+ shutdown_bt(u);
if (u->write_memchunk.memblock) {
pa_memblock_unref(u->write_memchunk.memblock);
@@ -1586,6 +1591,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
u->profile = *d;
u->sample_spec = u->requested_sample_spec;
+ init_bt(u);
init_profile(u);
if (u->sink || u->source)
@@ -1923,11 +1929,7 @@ void pa__done(pa_module *m) {
if (u->read_smoother)
pa_smoother_free(u->read_smoother);
- if (u->stream_fd >= 0)
- pa_close(u->stream_fd);
-
- if (u->service_fd >= 0)
- pa_close(u->service_fd);
+ shutdown_bt(u);
if (u->device)
pa_bluetooth_device_free(u->device);
commit 87e134277dd54b55a62284844e3f35d9ffd5f49c
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Feb 12 22:09:17 2009 +0100
don't claim that profile changes are always successful
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 8e1ba53..515d1f9 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -229,7 +229,7 @@ int pa_card_set_profile(pa_card *c, const char *name) {
pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c->index);
- pa_log_info("Successfully changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
+ pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
c->active_profile = profile;
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list