From ebf3e562f93e9eed82aeae22b673513fc6c90689 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 8 Apr 2013 15:11:58 -0400 Subject: Don't connect with PA_CONTEXT_NOFAIL NOFAIL means we don't fail if the daemon is not available when pa_context_connect() is called and instead enter PA_CONTEXT_CONNECTING state and wait for the daemon to appear. So currently if pulseaudio isn't running or available, ponymix will just block and wait. Since a lot of people use ponymix bound to their volume keys, this could potentially mean spawning 100s of processes before actually catching on that things aren't working. PA_CONTEXT_NOFLAGS was introduced in 0.9.19. Its really just 0. Signed-off-by: Simon Gomizelj --- pulse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pulse.cc') diff --git a/pulse.cc b/pulse.cc index 7f05bf6..e9cd28a 100644 --- a/pulse.cc +++ b/pulse.cc @@ -114,7 +114,7 @@ PulseClient::PulseClient(string client_name) : pa_proplist_free(proplist); pa_context_set_state_callback(context_, connect_state_cb, &state); - pa_context_connect(context_, nullptr, PA_CONTEXT_NOFAIL, nullptr); + pa_context_connect(context_, nullptr, PA_CONTEXT_NOFLAGS, nullptr); while (state != PA_CONTEXT_READY && state != PA_CONTEXT_FAILED) { pa_mainloop_iterate(mainloop_, 1, nullptr); } -- cgit v1.2.3