diff options
author | Chris Robinson <[email protected]> | 2009-12-28 10:49:31 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-12-28 10:49:31 -0800 |
commit | 2a735b14dcd97f8dc21256be145c6a5e22afc649 (patch) | |
tree | adcc34780f61a2730f4a5584507886fd04ef4dd0 | |
parent | a294dd8d9b46f2dadd9bb1006f5e4b42b9e02b88 (diff) |
Add an option to spawn a PulseAudio server on request
-rw-r--r-- | Alc/pulseaudio.c | 7 | ||||
-rw-r--r-- | alsoftrc.sample | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 0bc08e2d..a85e4b47 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -135,6 +135,7 @@ typedef struct { static const ALCchar pulse_device[] = "PulseAudio Software"; static const ALCchar pulse_capture_device[] = "PulseAudio Capture"; +static pa_context_flags_t pulse_ctx_flags; static volatile ALuint load_count; @@ -469,7 +470,7 @@ static ALCboolean pulse_open(ALCdevice *device, const ALCchar *device_name) //{{ ppa_context_set_state_callback(data->context, context_state_callback, device); - if(ppa_context_connect(data->context, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL) < 0) + if(ppa_context_connect(data->context, NULL, pulse_ctx_flags, NULL) < 0) { AL_PRINT("Context did not connect: %s\n", ppa_strerror(ppa_context_errno(data->context))); @@ -982,6 +983,10 @@ BackendFuncs pulse_funcs = { //{{{ void alc_pulse_init(BackendFuncs *func_list) //{{{ { *func_list = pulse_funcs; + + pulse_ctx_flags = 0; + if(!GetConfigValueBool("pulse", "spawn-server", 0)) + pulse_ctx_flags |= PA_CONTEXT_NOAUTOSPAWN; } //}}} void alc_pulse_deinit(void) //{{{ diff --git a/alsoftrc.sample b/alsoftrc.sample index 6f25d3eb..ed20c751 100644 --- a/alsoftrc.sample +++ b/alsoftrc.sample @@ -220,6 +220,14 @@ ## [pulse] +## spawn-server: +# Attempts to spawn a PulseAudio server when requesting to open a PulseAudio +# device. Note that some apps may open and probe all enumerated devices on +# startup, causing a server to spawn even if a PulseAudio device is not +# actually selected. Setting autospawn to false in Pulse's client.conf will +# still prevent autospawning even if this is set to true. +#spawn-server = false + ## ## Wave File Writer stuff ## |