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 /Alc/pulseaudio.c | |
parent | a294dd8d9b46f2dadd9bb1006f5e4b42b9e02b88 (diff) |
Add an option to spawn a PulseAudio server on request
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 7 |
1 files changed, 6 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) //{{{ |