[pulseaudio-commits] 6 commits - src/.gitignore src/modules src/pulsecore src/tests
Peter Meerwald
pmeerw at kemper.freedesktop.org
Mon Aug 18 06:35:10 PDT 2014
src/.gitignore | 2 +
src/modules/echo-cancel/module-echo-cancel.c | 6 ++---
src/modules/module-combine-sink.c | 2 -
src/pulsecore/core-util.c | 28 +++++++++++++++++++--------
src/pulsecore/memtrap.c | 3 ++
src/tests/mcalign-test.c | 2 -
src/tests/sigbus-test.c | 2 +
7 files changed, 32 insertions(+), 13 deletions(-)
New commits:
commit dc7ed820ab4de19275f6b2bb30f4bdd3f14f3331
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Wed Aug 13 01:19:37 2014 +0200
memtrap: Debian/kFreeBSD seems to signal SIGSEGV, not SIGBUS
handle both signals on Debian/kFreeBSD, otherwise sigbus-test fails:
Running suite(s): Sig Bus
Let's see if this worked: This is a test that should work fine.
And memtrap says it is good: yes
tests/sigbus-test.c:59:E:sigbus:sigbus_test:0: (after this point) Received signal 11 (Segmentation fault)
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/pulsecore/memtrap.c b/src/pulsecore/memtrap.c
index 87ea4fe..d04f278 100644
--- a/src/pulsecore/memtrap.c
+++ b/src/pulsecore/memtrap.c
@@ -237,5 +237,8 @@ void pa_memtrap_install(void) {
sa.sa_flags = SA_RESTART|SA_SIGINFO;
pa_assert_se(sigaction(SIGBUS, &sa, NULL) == 0);
+#ifdef __FreeBSD_kernel__
+ pa_assert_se(sigaction(SIGSEGV, &sa, NULL) == 0);
+#endif
#endif
}
commit c32e12e7b9d53cb6489112ee98c865cdb6e544c9
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Wed Aug 13 01:19:13 2014 +0200
tests: Check expected result of sigbus-test
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/tests/sigbus-test.c b/src/tests/sigbus-test.c
index c48df8a..6acac04 100644
--- a/src/tests/sigbus-test.c
+++ b/src/tests/sigbus-test.c
@@ -54,6 +54,7 @@ START_TEST (sigbus_test) {
/* Verify memory map */
pa_log("Let's see if this worked: %s", (char*) p);
pa_log("And memtrap says it is good: %s", pa_yes_no(pa_memtrap_is_good(m)));
+ fail_unless(pa_memtrap_is_good(m) == true);
/* Invalidate mapping */
fail_unless(ftruncate(fd, 0) >= 0);
@@ -64,6 +65,7 @@ START_TEST (sigbus_test) {
/* Verify memory map */
pa_log("Let's see if this worked: %s", (char*) p);
pa_log("And memtrap says it is good: %s", pa_yes_no(pa_memtrap_is_good(m)));
+ fail_unless(pa_memtrap_is_good(m) == false);
pa_memtrap_remove(m);
munmap(p, PA_PAGE_SIZE);
commit 454040116798da298f61ac0e8653a4806dc62aeb
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Wed Aug 13 00:30:01 2014 +0200
core-util: Avoid warnings when missing certain system calls
on systems lacking #defines HAVE_ACCEPT4, HAVE_PIPE2, SOCK_CLOEXEC
pulsecore/core-util.c: In function 'pa_open_cloexec':
pulsecore/core-util.c:3348:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_socket_cloexec':
pulsecore/core-util.c:3370:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_pipe_cloexec':
pulsecore/core-util.c:3393:1: warning: label 'finish' defined but not used [-Wunused-label]
pulsecore/core-util.c: In function 'pa_accept_cloexec':
pulsecore/core-util.c:3415:1: warning: label 'finish' defined but not used [-Wunused-label]
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 1f902f4..d7a95d6 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -3342,8 +3342,11 @@ int pa_open_cloexec(const char *fn, int flags, mode_t mode) {
return fd;
#endif
- if ((fd = open(fn, flags, mode)) < 0)
- return fd;
+ if ((fd = open(fn, flags, mode)) >= 0)
+ goto finish;
+
+ /* return error */
+ return fd;
finish:
/* Some implementations might simply ignore O_CLOEXEC if it is not
@@ -3364,8 +3367,11 @@ int pa_socket_cloexec(int domain, int type, int protocol) {
return fd;
#endif
- if ((fd = socket(domain, type, protocol)) < 0)
- return fd;
+ if ((fd = socket(domain, type, protocol)) >= 0)
+ goto finish;
+
+ /* return error */
+ return fd;
finish:
/* Some implementations might simply ignore SOCK_CLOEXEC if it is
@@ -3387,8 +3393,11 @@ int pa_pipe_cloexec(int pipefd[2]) {
#endif
- if ((r = pipe(pipefd)) < 0)
- return r;
+ if ((r = pipe(pipefd)) >= 0)
+ goto finish;
+
+ /* return error */
+ return r;
finish:
pa_make_fd_cloexec(pipefd[0]);
@@ -3409,8 +3418,11 @@ int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
#endif
- if ((fd = accept(sockfd, addr, addrlen)) < 0)
- return fd;
+ if ((fd = accept(sockfd, addr, addrlen)) >= 0)
+ goto finish;
+
+ /* return error */
+ return fd;
finish:
pa_make_fd_cloexec(fd);
commit 1849cfdad92cb56f5510f46405c98caa9e6b7577
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Wed Aug 13 00:21:04 2014 +0200
misc: Fix format specifiers
to print a pa_usec_t, the format specifier to use is "%" PRIu64
modules/module-combine-sink.c: In function 'update_latency_range':
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'pa_usec_t' [-Wformat]
modules/module-combine-sink.c:750:5: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'pa_usec_t' [-Wformat]
to print a size_t, use %zu
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
index 48f5621..9040314 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.c
@@ -747,7 +747,7 @@ static void update_latency_range(struct userdata *u) {
if (max_latency < min_latency)
max_latency = min_latency;
- pa_log_debug("Sink update latency range %lu %lu", min_latency, max_latency);
+ pa_log_debug("Sink update latency range %" PRIu64 " %" PRIu64, min_latency, max_latency);
pa_sink_set_latency_range_within_thread(u->sink, min_latency, max_latency);
}
diff --git a/src/tests/mcalign-test.c b/src/tests/mcalign-test.c
index bd192b5..443b4a7 100644
--- a/src/tests/mcalign-test.c
+++ b/src/tests/mcalign-test.c
@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
c.length = (size_t) r;
pa_mcalign_push(a, &c);
- fprintf(stderr, "Read %ld bytes\n", (long)r);
+ fprintf(stderr, "Read %zd bytes\n", r);
c.index += (size_t) r;
commit 8d2d7da5e602de75ddf241cdc41a03f9d30ad8ab
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Tue Aug 12 22:28:24 2014 +0200
echo-cancel: Fix spelling of canceller
use canceller consistently
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 62429fd..c755119 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -168,7 +168,7 @@ static const pa_echo_canceller ec_table[] = {
* capture and playback samples, we perform a resync. This adjusts the
* position in the playback memblock to the requested sample. Quick
* adjustments include moving the playback samples before the capture
- * samples (because else the echo canceler does not work) or when the
+ * samples (because else the echo canceller does not work) or when the
* playback pointer drifts too far away.
*
* 2) periodically check the difference between capture and playback. We use a
@@ -224,7 +224,7 @@ struct userdata {
pa_source *source;
bool source_auto_desc;
pa_source_output *source_output;
- pa_memblockq *source_memblockq; /* echo canceler needs fixed sized chunks */
+ pa_memblockq *source_memblockq; /* echo canceller needs fixed sized chunks */
size_t source_skip;
pa_sink *sink;
@@ -362,7 +362,7 @@ static void time_callback(pa_mainloop_api *a, pa_time_event *e, const struct tim
if (diff_time < 0) {
/* recording before playback, we need to adjust quickly. The echo
- * canceler does not work in this case. */
+ * canceller does not work in this case. */
pa_asyncmsgq_post(u->asyncmsgq, PA_MSGOBJECT(u->source_output), SOURCE_OUTPUT_MESSAGE_APPLY_DIFF_TIME,
NULL, diff_time, NULL, NULL);
/*new_rate = base_rate - ((pa_usec_to_bytes(-diff_time, &u->source_output->sample_spec) / fs) * PA_USEC_PER_SEC) / u->adjust_time;*/
commit eaab16d8ba846ce8c3d27bda4e19d19f1ac4c5cd
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date: Tue Aug 12 22:21:04 2014 +0200
tests: Add *.log and *.trs to src/.gitignore
these files are created by running 'make check'
Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
diff --git a/src/.gitignore b/src/.gitignore
index fad9f49..1490262 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -3,6 +3,8 @@ TAGS
*.o
*.la
*.gcno
+*.trs
+*.log
.deps
.libs
/Makefile
More information about the pulseaudio-commits
mailing list