[pulseaudio-commits] 5 commits - src/daemon src/modules
Arun Raghavan
arun at kemper.freedesktop.org
Mon May 28 20:56:48 PDT 2012
src/daemon/daemon-conf.c | 12 ++++++------
src/modules/bluetooth/module-bluetooth-device.c | 13 ++++++++++---
src/modules/module-pipe-sink.c | 9 ++++++---
src/modules/module-pipe-source.c | 15 +++++++++------
src/modules/module-udev-detect.c | 9 +++------
src/modules/udev-util.c | 4 ++--
6 files changed, 36 insertions(+), 26 deletions(-)
New commits:
commit 0236977408b92259086010e69b2d64361d52391c
Author: Jarkko Suontausta <jarkko.suontausta at digia.com>
Date: Tue May 22 15:58:33 2012 +0300
bluetooth: Release transport when the pa_rtpoll_run loop finishes.
Based on a patch by Marko Ollonen.
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 0b12cc7..68c4efc 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1731,11 +1731,18 @@ static void thread_func(void *userdata) {
pollfd->events = (short) (((u->sink && PA_SINK_IS_LINKED(u->sink->thread_info.state) && !writable) ? POLLOUT : 0) |
(u->source && PA_SOURCE_IS_LINKED(u->source->thread_info.state) ? POLLIN : 0));
- if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
+ if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) {
+ pa_log_debug("pa_rtpoll_run failed with: %d", ret);
goto fail;
-
- if (ret == 0)
+ }
+ if (ret == 0) {
+ pa_log_debug("IO thread shutdown requested, stopping cleanly");
+ if (u->transport)
+ bt_transport_release(u);
+ else
+ stop_stream_fd(u);
goto finish;
+ }
pollfd = u->rtpoll_item ? pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL) : NULL;
commit 54718450dfd1e7fc9b5946f62765f7451a854385
Author: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
Date: Thu May 17 22:50:22 2012 +0200
udev: Don't use deprecated udev_get_*_path() functions
[These symbols were removed in libudev.so.1.0.0. Replace them with
hardcoded strings. -- heftig]
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
diff --git a/src/modules/module-udev-detect.c b/src/modules/module-udev-detect.c
index 1192194..31416bd 100644
--- a/src/modules/module-udev-detect.c
+++ b/src/modules/module-udev-detect.c
@@ -123,7 +123,7 @@ static char *card_get_sysattr(const char *card_idx, const char *name) {
goto finish;
}
- t = pa_sprintf_malloc("%s/class/sound/card%s", udev_get_sys_path(udev), card_idx);
+ t = pa_sprintf_malloc("/sys/class/sound/card%s", card_idx);
card = udev_device_new_from_syspath(udev, t);
pa_xfree(t);
@@ -282,7 +282,7 @@ static void verify_access(struct userdata *u, struct device *d) {
pa_assert(u);
pa_assert(d);
- cd = pa_sprintf_malloc("%s/snd/controlC%s", udev_get_dev_path(u->udev), path_get_card_id(d->path));
+ cd = pa_sprintf_malloc("/dev/snd/controlC%s", path_get_card_id(d->path));
accessible = access(cd, R_OK|W_OK) >= 0;
pa_log_debug("%s is accessible: %s", cd, pa_yes_no(accessible));
@@ -621,7 +621,6 @@ fail:
}
static int setup_inotify(struct userdata *u) {
- char *dev_snd;
int r;
if (u->inotify_fd >= 0)
@@ -632,9 +631,7 @@ static int setup_inotify(struct userdata *u) {
return -1;
}
- dev_snd = pa_sprintf_malloc("%s/snd", udev_get_dev_path(u->udev));
- r = inotify_add_watch(u->inotify_fd, dev_snd, IN_ATTRIB|IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF);
- pa_xfree(dev_snd);
+ r = inotify_add_watch(u->inotify_fd, "/dev/snd", IN_ATTRIB|IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF);
if (r < 0) {
int saved_errno = errno;
diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c
index 2f18bc4..b0bb17d 100644
--- a/src/modules/udev-util.c
+++ b/src/modules/udev-util.c
@@ -180,7 +180,7 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
goto finish;
}
- t = pa_sprintf_malloc("%s/class/sound/card%i", udev_get_sys_path(udev), card_idx);
+ t = pa_sprintf_malloc("/sys/class/sound/card%i", card_idx);
card = udev_device_new_from_syspath(udev, t);
pa_xfree(t);
@@ -277,7 +277,7 @@ char* pa_udev_get_property(int card_idx, const char *name) {
goto finish;
}
- t = pa_sprintf_malloc("%s/class/sound/card%i", udev_get_sys_path(udev), card_idx);
+ t = pa_sprintf_malloc("/sys/class/sound/card%i", card_idx);
card = udev_device_new_from_syspath(udev, t);
pa_xfree(t);
commit 77e73be925f47285d0f04ac4a753c6c8e1132144
Author: Peter Meerwald <p.meerwald at bct-electronic.com>
Date: Thu May 24 17:52:56 2012 +0200
pipe: check return value of mkfifo()
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index fa0a080..ef18fad 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -255,7 +255,10 @@ int pa__init(pa_module *m) {
u->filename = pa_runtime_path(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
- mkfifo(u->filename, 0666);
+ if (mkfifo(u->filename, 0666) < 0) {
+ pa_log("mkfifo('%s'): %s", u->filename, pa_cstrerror(errno));
+ goto fail;
+ }
if ((u->fd = pa_open_cloexec(u->filename, O_RDWR, 0)) < 0) {
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
goto fail;
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index eb531d8..7a7dfb2 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -240,7 +240,10 @@ int pa__init(pa_module *m) {
u->filename = pa_runtime_path(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
- mkfifo(u->filename, 0666);
+ if (mkfifo(u->filename, 0666) < 0) {
+ pa_log("mkfifo('%s'): %s", u->filename, pa_cstrerror(errno));
+ goto fail;
+ }
if ((u->fd = pa_open_cloexec(u->filename, O_RDWR, 0)) < 0) {
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
goto fail;
commit c87fd823eaa3437f01b4cd5ed65f773f7f567273
Author: Peter Meerwald <p.meerwald at bct-electronic.com>
Date: Thu May 24 17:52:55 2012 +0200
pipe: whitespace and log output cleanup
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index 91e01f9..fa0a080 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -221,7 +221,7 @@ finish:
pa_log_debug("Thread shutting down");
}
-int pa__init(pa_module*m) {
+int pa__init(pa_module *m) {
struct userdata *u;
struct stat st;
pa_sample_spec ss;
@@ -338,7 +338,7 @@ int pa__get_n_used(pa_module *m) {
return pa_sink_linked_by(u->sink);
}
-void pa__done(pa_module*m) {
+void pa__done(pa_module *m) {
struct userdata *u;
pa_assert(m);
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index 3335907..eb531d8 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -208,7 +208,7 @@ finish:
pa_log_debug("Thread shutting down");
}
-int pa__init(pa_module*m) {
+int pa__init(pa_module *m) {
struct userdata *u;
struct stat st;
pa_sample_spec ss;
@@ -220,14 +220,14 @@ int pa__init(pa_module*m) {
pa_assert(m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
- pa_log("failed to parse module arguments.");
+ pa_log("Failed to parse module arguments.");
goto fail;
}
ss = m->core->default_sample_spec;
map = m->core->default_channel_map;
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_DEFAULT) < 0) {
- pa_log("invalid sample format specification or channel map");
+ pa_log("Invalid sample format specification or channel map");
goto fail;
}
@@ -249,7 +249,7 @@ int pa__init(pa_module*m) {
pa_make_fd_nonblock(u->fd);
if (fstat(u->fd, &st) < 0) {
- pa_log("fstat('%s'): %s",u->filename, pa_cstrerror(errno));
+ pa_log("fstat('%s'): %s", u->filename, pa_cstrerror(errno));
goto fail;
}
@@ -322,7 +322,7 @@ int pa__get_n_used(pa_module *m) {
return pa_source_linked_by(u->source);
}
-void pa__done(pa_module*m) {
+void pa__done(pa_module *m) {
struct userdata *u;
pa_assert(m);
commit 9be176f40312a38882e1db46645b136e69b2cad4
Author: Deng Zhengrong <dzrongg at gmail.com>
Date: Fri May 25 10:17:51 2012 +0800
daemon: use pa_streq instead of plain strcmp
Just noticed that in daemon-conf.c, it uses plain strcmp(),
while in PulseAudio, it should be better to use pa_streq().
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 3ef7f81..dd2e7b6 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -180,12 +180,12 @@ int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string) {
pa_assert(c);
pa_assert(string);
- if (!strcmp(string, "auto"))
+ if (pa_streq(string, "auto"))
c->auto_log_target = 1;
- else if (!strcmp(string, "syslog")) {
+ else if (pa_streq(string, "syslog")) {
c->auto_log_target = 0;
c->log_target = PA_LOG_SYSLOG;
- } else if (!strcmp(string, "stderr")) {
+ } else if (pa_streq(string, "stderr")) {
c->auto_log_target = 0;
c->log_target = PA_LOG_STDERR;
} else if (pa_startswith(string, "file:")) {
@@ -251,11 +251,11 @@ int pa_daemon_conf_set_local_server_type(pa_daemon_conf *c, const char *string)
pa_assert(c);
pa_assert(string);
- if (!strcmp(string, "user"))
+ if (pa_streq(string, "user"))
c->local_server_type = PA_SERVER_TYPE_USER;
- else if (!strcmp(string, "system")) {
+ else if (pa_streq(string, "system")) {
c->local_server_type = PA_SERVER_TYPE_SYSTEM;
- } else if (!strcmp(string, "none")) {
+ } else if (pa_streq(string, "none")) {
c->local_server_type = PA_SERVER_TYPE_NONE;
} else
return -1;
More information about the pulseaudio-commits
mailing list