diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-08-22 12:51:29 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-08-22 12:51:29 +0000 |
commit | 7bf25407789a99eec9d77ec8b9f9ece8abe49589 (patch) | |
tree | 79672b06dd4d1384532eede4c5ed8344760d1239 /src | |
parent | 26bfce6281f475d04f122dee6a711c7c00496614 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/pulsecore/core.c | 17 |
1 files changed, 13 insertions, 4 deletions
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; |