From 7bf25407789a99eec9d77ec8b9f9ece8abe49589 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 22 Aug 2006 12:51:29 +0000 Subject: Fall back to creating a "normal" memory pool if unable to get a shared one. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1321 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/core.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c index 1a7382e5..3b6434d7 100644 --- a/src/pulsecore/core.c +++ b/src/pulsecore/core.c @@ -49,11 +49,20 @@ pa_core* pa_core_new(pa_mainloop_api *m, int shared) { pa_core* c; pa_mempool *pool; - if (!(pool = pa_mempool_new(shared))) { - pa_log("pa_mempool_new() failed."); - return NULL; + if (shared) { + if (!(pool = pa_mempool_new(shared))) { + pa_log_warn("failed to allocate shared memory pool. Falling back to a normal memory pool."); + shared = 0; + } + } + + if (!shared) { + if (!(pool = pa_mempool_new(shared))) { + pa_log("pa_mempool_new() failed."); + return NULL; + } } - + c = pa_xnew(pa_core, 1); c->mainloop = m; -- cgit