core: Replace PA_PAGE_SIZE with pa_page_size()

PA_PAGE_SIZE using sysconf() may return a negative number

CID 1137925, CID 1137926, CID 1138485

instead of calling sysconf() directly, add function pa_page_size()
which uses the guestimate 4096 in case sysconf(_SC_PAGE_SIZE) fails

using PA_ONCE to only evaluate sysconf() once
This commit is contained in:
Peter Meerwald-Stadler 2016-08-18 01:06:47 +02:00
parent c99efbffd6
commit 45d9030638
10 changed files with 55 additions and 38 deletions

View file

@ -39,7 +39,7 @@
#include "sample-util.h"
#define PA_SILENCE_MAX (PA_PAGE_SIZE*16)
#define PA_SILENCE_MAX (pa_page_size()*16)
pa_memblock *pa_silence_memblock(pa_memblock* b, const pa_sample_spec *spec) {
void *data;