diff options
author | Chris Robinson <[email protected]> | 2019-08-12 03:59:52 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-12 03:59:52 -0700 |
commit | 1aaf65abfecbde8548f90b1d0b0308b21bd0776d (patch) | |
tree | 767a9d1c72bd78ea572890286be92a866033f36e /alc/backends | |
parent | 50d16d2422febe2f4f56e7f29794778b10606b3a (diff) |
Add methods to get env vars as an optional
Diffstat (limited to 'alc/backends')
-rw-r--r-- | alc/backends/pulseaudio.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index ca2ecb43..499a192f 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -40,6 +40,7 @@ #include "alexcpt.h" #include "compat.h" #include "dynload.h" +#include "strutils.h" #include <pulse/pulseaudio.h> @@ -855,8 +856,8 @@ ALCenum PulsePlayback::open(const ALCchar *name) if(!pulse_name) { - pulse_name = getenv("ALSOFT_PULSE_DEFAULT"); - if(pulse_name && !pulse_name[0]) pulse_name = nullptr; + static const auto defname = al::getenv("ALSOFT_PULSE_DEFAULT"); + if(defname) pulse_name = defname->c_str(); } TRACE("Connecting to \"%s\"\n", pulse_name ? pulse_name : "(default)"); mStream = pulse_connect_stream(pulse_name, plock, mContext, flags, nullptr, &spec, nullptr, |