aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-09 02:27:01 -0800
committerChris Robinson <[email protected]>2023-01-09 02:27:01 -0800
commitd9c1ce8348ef99603f8c034e29dab015ec8ec99b (patch)
treea36859c2ebcd856ba6fe68df36d6cf9e8556b304 /alc
parentd2cb6303388185b7830b2d79ffe3d0102ff03f10 (diff)
Fix handling the ALC_HRTF_SOFT attribute
Diffstat (limited to 'alc')
-rw-r--r--alc/alc.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index cf510ab4..cfc58cbc 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -1903,7 +1903,15 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
else if(*optchans == DevFmtStereo)
{
if(opthrtf)
- stereomode = *opthrtf ? StereoEncoding::Hrtf : StereoEncoding::Default;
+ {
+ if(*opthrtf)
+ stereomode = StereoEncoding::Hrtf;
+ else
+ {
+ if(stereomode.value_or(StereoEncoding::Hrtf) == StereoEncoding::Hrtf)
+ stereomode = StereoEncoding::Default;
+ }
+ }
if(outmode == ALC_STEREO_BASIC_SOFT)
stereomode = StereoEncoding::Basic;
@@ -1917,6 +1925,17 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
}
else
{
+ if(opthrtf)
+ {
+ if(*opthrtf)
+ stereomode = StereoEncoding::Hrtf;
+ else
+ {
+ if(stereomode.value_or(StereoEncoding::Hrtf) == StereoEncoding::Hrtf)
+ stereomode = StereoEncoding::Default;
+ }
+ }
+
if(outmode != ALC_ANY_SOFT)
{
using OutputMode = ALCdevice::OutputMode;