From ff95a96e61effeffdb083018af80f1829dacbab9 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 1 Aug 2015 14:34:35 +0200 Subject: [PATCH] Allow more stack space for thread, include freebsd in the name of condional compilation variable --- player.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/player.c b/player.c index 522b6fa4..29fb1810 100644 --- a/player.c +++ b/player.c @@ -663,7 +663,7 @@ static abuf_t *buffer_get_frame(void) { time_to_wait_for_wakeup_fp *= 4 * 352; // four full 352-frame packets time_to_wait_for_wakeup_fp /= 3; // four thirds of a packet time -#ifdef COMPILE_FOR_LINUX +#ifdef COMPILE_FOR_LINUX_AND_FREEBSD uint64_t time_of_wakeup_fp = local_time_now + time_to_wait_for_wakeup_fp; uint64_t sec = time_of_wakeup_fp >> 32; uint64_t nsec = ((time_of_wakeup_fp & 0xffffffff) * 1000000000) >> 32; @@ -1268,7 +1268,7 @@ int player_play(stream_cfg *stream) { #endif // set the flowcontrol condition variable to wait on a monotonic clock -#ifdef COMPILE_FOR_LINUX +#ifdef COMPILE_FOR_LINUX_AND_FREEBSD pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); // can't do this in OS X, and don't need it. @@ -1280,7 +1280,7 @@ int player_play(stream_cfg *stream) { if (rc) debug(1, "Error initialising condition variable."); config.output->start(sampling_rate); - size_t size = (PTHREAD_STACK_MIN + 128 * 1024); + size_t size = (PTHREAD_STACK_MIN + 256 * 1024); pthread_attr_t tattr; pthread_attr_init(&tattr); rc = pthread_attr_setstacksize(&tattr, size);