[pulseaudio-commits] 6 commits - src/modules src/pulse src/tests
Peter Meerwald
pmeerw at kemper.freedesktop.org
Mon Aug 15 21:54:58 UTC 2016
src/modules/alsa/module-alsa-card.c | 5 ++++-
src/modules/module-ladspa-sink.c | 2 +-
src/modules/module-zeroconf-publish.c | 3 ++-
src/pulse/stream.c | 8 +++-----
src/tests/alsa-time-test.c | 1 +
src/tests/rtpoll-test.c | 4 ++--
6 files changed, 13 insertions(+), 10 deletions(-)
New commits:
commit 9cc778123fb9528a728d0a60e5db6e57f15cbaf0
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Sep 15 16:42:58 2015 +0200
modules: Use pa_assert_se() to check return value of dbus_message_iter_close_container()
CID 1140353
... as it is done everythere else
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index a6290b9..c11fa5e 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -166,7 +166,7 @@ static void get_algorithm_parameters(DBusConnection *conn, DBusMessage *msg, voi
pa_dbus_append_basic_array(&struct_iter, DBUS_TYPE_DOUBLE, control, u->n_control);
pa_dbus_append_basic_array(&struct_iter, DBUS_TYPE_BOOLEAN, use_default, u->n_control);
- dbus_message_iter_close_container(&msg_iter, &struct_iter);
+ pa_assert_se(dbus_message_iter_close_container(&msg_iter, &struct_iter));
pa_assert_se(dbus_connection_send(conn, reply, NULL));
commit a5dae93d9fc48c0075a20a0d748a8002ad6a3dd5
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Sep 15 22:34:48 2015 +0200
tests: Check pa_rtpoll_run() return value
CID 1138499
diff --git a/src/tests/rtpoll-test.c b/src/tests/rtpoll-test.c
index 7db7177..24c6619 100644
--- a/src/tests/rtpoll-test.c
+++ b/src/tests/rtpoll-test.c
@@ -60,7 +60,7 @@ START_TEST (rtpoll_test) {
pa_rtpoll_set_timer_relative(p, 10000000); /* 10 s */
- pa_rtpoll_run(p);
+ fail_unless(pa_rtpoll_run(p) >= 0);
pa_rtpoll_item_free(i);
@@ -72,7 +72,7 @@ START_TEST (rtpoll_test) {
pollfd->fd = 0;
pollfd->events = POLLIN;
- pa_rtpoll_run(p);
+ fail_unless(pa_rtpoll_run(p) >= 0);
pa_rtpoll_item_free(i);
commit 05d964cf81e70e777e2bdd80f7462b40a7830a66
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Sep 15 16:49:14 2015 +0200
modules: Check pa_threaded_mainloop_start() return value
CID 1138500
diff --git a/src/modules/module-zeroconf-publish.c b/src/modules/module-zeroconf-publish.c
index ceedfe0..6ca0369 100644
--- a/src/modules/module-zeroconf-publish.c
+++ b/src/modules/module-zeroconf-publish.c
@@ -766,7 +766,8 @@ int pa__init(pa_module*m) {
pa_xfree(hn);
pa_threaded_mainloop_set_name(u->mainloop, "avahi-ml");
- pa_threaded_mainloop_start(u->mainloop);
+ if (pa_threaded_mainloop_start(u->mainloop) < 0)
+ goto fail;
pa_threaded_mainloop_lock(u->mainloop);
pa_mainloop_api_once(u->api, create_client, u);
commit b3e4d28d2558bfb8ee359eb7d37b1751458d5529
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Tue Sep 15 23:11:29 2015 +0200
stream: Check pa_tagstruct_get_format_info() retval in pa_create_stream_callback()
CID 1137984
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 6fea996..e10ab12 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -1137,18 +1137,16 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag,
|| s->context->version >= 22) {
pa_format_info *f = pa_format_info_new();
- pa_tagstruct_get_format_info(t, f);
- if (pa_format_info_valid(f))
- s->format = f;
- else {
+ if (pa_tagstruct_get_format_info(t, f) < 0 || !pa_format_info_valid(f)) {
pa_format_info_free(f);
if (s->n_formats > 0) {
/* We used the extended API, so we should have got back a proper format */
pa_context_fail(s->context, PA_ERR_PROTOCOL);
goto finish;
}
- }
+ } else
+ s->format = f;
}
if (!pa_tagstruct_eof(t)) {
commit f173f5a8a507c7ca7b8e3459e446ed6622397dac
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Mon Sep 14 16:48:10 2015 +0200
tests: Assert fillrate > 0 in alsa-time-test
CID 1323592
assert that fillrate is strictly positive
diff --git a/src/tests/alsa-time-test.c b/src/tests/alsa-time-test.c
index b4eedab..a877cb8 100644
--- a/src/tests/alsa-time-test.c
+++ b/src/tests/alsa-time-test.c
@@ -60,6 +60,7 @@ int main(int argc, char *argv[]) {
dev = argc > 1 ? argv[1] : "front:0";
cap = argc > 2 ? atoi(argv[2]) : 0;
fillrate = argc > 3 ? atoi(argv[3]) : 1;
+ assert(fillrate > 0);
samples = calloc(fillrate, CHANNELS*sizeof(uint16_t));
assert(samples);
commit 61344493bf4d7dc7bf7b320b57cff76117308a2c
Author: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
Date: Mon Aug 15 23:11:50 2016 +0200
alsa: Check pa_modargs_get_value_boolean() retval for use_ucm
CID 1137983
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index d807a82..4f1236e 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -741,7 +741,10 @@ int pa__init(pa_module *m) {
}
}
- pa_modargs_get_value_boolean(u->modargs, "use_ucm", &u->use_ucm);
+ if (pa_modargs_get_value_boolean(u->modargs, "use_ucm", &u->use_ucm) < 0) {
+ pa_log("Failed to parse use_ucm argument.");
+ goto fail;
+ }
/* Force ALSA to reread its configuration. This matters if our device
* was hot-plugged after ALSA has already read its configuration - see
More information about the pulseaudio-commits
mailing list