From e36132b7dcc4283b1f8b89a14f145966e7264463 Mon Sep 17 00:00:00 2001 From: Tom Yan Date: Sun, 16 Aug 2020 20:16:01 +0000 Subject: [PATCH] main, core: check idle after loading conf pa_core_check_idle() uses pa_core.exit_idle_time, which is set after the pa_core_new() call, so pa_core_check_idle() needs to be called later. This patch preserves the fact that core state is set to PA_CORE_RUNNING after checking idle (now in main). It doesn't seem to matter anyway and main(pa_core_new(state:PA_CORE_STARTUP)->...->state:PA_CORE_RUNNING) seems right as well. --- src/daemon/main.c | 4 ++++ src/pulsecore/core.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/daemon/main.c b/src/daemon/main.c index f1810c5f1..59f931219 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -1067,6 +1067,10 @@ int main(int argc, char *argv[]) { c->server_type = conf->local_server_type; #endif + pa_core_check_idle(c); + + c->state = PA_CORE_RUNNING; + pa_cpu_init(&c->cpu_info); pa_assert_se(pa_signal_init(pa_mainloop_get_api(mainloop)) == 0); diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c index 335f8029e..c28c5312b 100644 --- a/src/pulsecore/core.c +++ b/src/pulsecore/core.c @@ -159,10 +159,6 @@ pa_core* pa_core_new(pa_mainloop_api *m, bool shared, bool enable_memfd, size_t pa_check_signal_is_blocked(SIGPIPE); #endif - pa_core_check_idle(c); - - c->state = PA_CORE_RUNNING; - return c; }