aboutsummaryrefslogtreecommitdiffstats
path: root/alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-03-27 06:15:39 -0700
committerChris Robinson <[email protected]>2022-03-29 11:48:57 -0700
commit6bc1787a3bc1d578cbafe2293549b8999cf3860e (patch)
tree19b3ed4dc4e80743b274b1e405af6d7834839cc8 /alc/panning.cpp
parent4ca8992fbd8a367973f23046a4f6b23980090e18 (diff)
Make and use a Default enum for StereoEncoding
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r--alc/panning.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 3431a3f9..00bf5662 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -981,11 +981,11 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, al::optional<StereoEncoding
}
- /* If there's no request for HRTF or UHJ and the device is headphones, or
- * if HRTF is explicitly requested, try to enable it.
+ /* If HRTF is explicitly requested, or if there's no explicit request and
+ * the device is headphones, try to enable it.
*/
- if((!stereomode && device->Flags.test(DirectEar))
- || (stereomode && *stereomode == StereoEncoding::Hrtf))
+ if(stereomode.value_or(StereoEncoding::Default) == StereoEncoding::Hrtf
+ || (!stereomode && device->Flags.test(DirectEar)))
{
if(device->mHrtfList.empty())
device->enumerateHrtfs();
@@ -1033,7 +1033,7 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, al::optional<StereoEncoding
}
old_hrtf = nullptr;
- if(stereomode && *stereomode == StereoEncoding::Uhj)
+ if(stereomode.value_or(StereoEncoding::Default) == StereoEncoding::Uhj)
{
device->mUhjEncoder = std::make_unique<UhjEncoder>();
TRACE("UHJ enabled\n");