aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-05-16 16:50:43 -0700
committerChris Robinson <[email protected]>2017-05-16 16:50:43 -0700
commita49e2ebbc56e8694a03a150e4210f4070203e43d (patch)
treed13894f865baa1f63d41ba4ef53624dbf7674fad
parent154e53b911f08b435f4d9579189400bd15fd5ee0 (diff)
Add an env var to specify a default pulse device
Some apps don't allow selecting an audio device, and due to problems with KDE, PulseAudio isn't allowed to move the stream after being created by default.
-rw-r--r--Alc/backends/pulseaudio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index 9e2d4f73..43761e23 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -764,6 +764,13 @@ static pa_stream *ALCpulsePlayback_connectStream(const char *device_name,
pa_stream_state_t state;
pa_stream *stream;
+ if(!device_name)
+ {
+ device_name = getenv("ALSOFT_PULSE_DEFAULT");
+ if(device_name && !device_name[0])
+ device_name = NULL;
+ }
+
stream = pa_stream_new_with_proplist(context, "Playback Stream", spec, chanmap, prop_filter);
if(!stream)
{