summaryrefslogtreecommitdiff
path: root/src/modules/module-waveout.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2016-09-13 18:43:38 +0300
committerTanu Kaskinen <tanuk@iki.fi>2016-12-20 01:19:06 +0200
commit60695e3d84c98e4153edd5dda9dbf1dd7fde0de0 (patch)
treee52b7afffdc91dff9b035383951cd87a35b772c4 /src/modules/module-waveout.c
parent3e52972c610f0609c11e592c761379ea6ab8803f (diff)
downloadpulseaudio-60695e3d84c98e4153edd5dda9dbf1dd7fde0de0.tar.gz
don't assume that pa_asyncq_new() always succeeds
Bug 96741 shows a case where an assertion is hit, because pa_asyncq_new() failed due to running out of file descriptors. pa_asyncq_new() is used in only one place (not counting the call in asyncq-test): pa_asyncmsgq_new(). Now pa_asyncmsgq_new() can fail too, which requires error handling in many places. One of those places is pa_thread_mq_init(), which can now fail too, and that needs additional error handling in many more places. Luckily there weren't any places where adding better error handling wouldn't have been easy, so there are many changes in this patch, but they are not complicated. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96741
Diffstat (limited to 'src/modules/module-waveout.c')
-rw-r--r--src/modules/module-waveout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c
index ab3ea74cb..0b219f1fb 100644
--- a/src/modules/module-waveout.c
+++ b/src/modules/module-waveout.c
@@ -684,7 +684,11 @@ int pa__init(pa_module *m) {
sink_get_volume_cb(u->sink);
u->rtpoll = pa_rtpoll_new();
- pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
+
+ if (pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll) < 0) {
+ pa_log("pa_thread_mq_init() failed.");
+ goto fail;
+ }
if (u->sink) {
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);