summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/OpenALStream.cpp
diff options
context:
space:
mode:
authorMichael Maltese <mchtly@gmail.com>2017-03-30 13:52:38 -0700
committerMichael Maltese <mchtly@gmail.com>2017-06-06 15:23:55 -0700
commit3bfebf396a040ebec81d87fb15fa6ab27cc9241b (patch)
tree5589a4f152860cf7177e17b252fa5e7b578bb6d0 /Source/Core/AudioCommon/OpenALStream.cpp
parentc07058a4ada4ca28c1621b50c9af3da7c70a0a65 (diff)
Fix OpenAL backend on macOS
OpenALStream was querying the backend for AL_EXT_float32 support (which suceeds), but AL_FORMAT_STEREO_FLOAT32 was defined incorrectly. Also changes OpenALStream to query for AL_EXT_MCFORMATS (multichannel support) rather than hard-coding that it doesn't work on macOS.
Diffstat (limited to 'Source/Core/AudioCommon/OpenALStream.cpp')
-rw-r--r--Source/Core/AudioCommon/OpenALStream.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/Source/Core/AudioCommon/OpenALStream.cpp b/Source/Core/AudioCommon/OpenALStream.cpp
index ca343be005..b923522799 100644
--- a/Source/Core/AudioCommon/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/OpenALStream.cpp
@@ -159,13 +159,14 @@ void OpenALStream::SoundLoop()
{
Common::SetCurrentThreadName("Audio thread - openal");
- bool surround_capable = SConfig::GetInstance().bDPL2Decoder;
- bool float32_capable = false;
- bool fixed32_capable = false;
+ bool float32_capable = alIsExtensionPresent("AL_EXT_float32") != 0;
+ bool surround_capable =
+ SConfig::GetInstance().bDPL2Decoder && alIsExtensionPresent("AL_EXT_MCFORMATS");
-#if defined(__APPLE__)
- surround_capable = false;
-#endif
+ // As there is no extension to check for 32-bit fixed point support
+ // and we know that only a X-Fi with hardware OpenAL supports it,
+ // we just check if one is being used.
+ bool fixed32_capable = strstr(alGetString(AL_RENDERER), "X-Fi") != nullptr;
u32 ulFrequency = m_mixer->GetSampleRate();
numBuffers = SConfig::GetInstance().iLatency + 2; // OpenAL requires a minimum of two buffers
@@ -173,15 +174,6 @@ void OpenALStream::SoundLoop()
memset(uiBuffers, 0, numBuffers * sizeof(ALuint));
uiSource = 0;
- if (alIsExtensionPresent("AL_EXT_float32"))
- float32_capable = true;
-
- // As there is no extension to check for 32-bit fixed point support
- // and we know that only a X-Fi with hardware OpenAL supports it,
- // we just check if one is being used.
- if (strstr(alGetString(AL_RENDERER), "X-Fi"))
- fixed32_capable = true;
-
// Clear error state before querying or else we get false positives.
ALenum err = alGetError();