Commit d1b36370 authored by David Reid's avatar David Reid

OpenAL: Improvements to how the shared library is opened at runtime.

parent a03d2a3f
...@@ -9376,29 +9376,26 @@ mal_result mal_context_init__openal(mal_context* pContext) ...@@ -9376,29 +9376,26 @@ mal_result mal_context_init__openal(mal_context* pContext)
mal_assert(pContext != NULL); mal_assert(pContext != NULL);
#ifndef MAL_NO_RUNTIME_LINKING #ifndef MAL_NO_RUNTIME_LINKING
const char* libName = NULL; const char* libNames[] = {
#ifdef MAL_WIN32 #if defined(MAL_WIN32)
libName = "OpenAL32.dll"; "OpenAL32.dll",
"soft_oal.dll"
#endif #endif
#if defined(MAL_UNIX) && !defined(MAL_APPLE) #if defined(MAL_UNIX) && !defined(MAL_APPLE)
libName = "libopenal.so"; "libopenal.so",
"libopenal.so.1"
#endif #endif
#ifdef MAL_APPLE #if defined(MAL_APPLE)
libName = "OpenAL.framework/OpenAL"; "OpenAL.framework/OpenAL"
#endif #endif
if (libName == NULL) { };
return MAL_NO_BACKEND; // Don't know what the library name is called.
}
pContext->openal.hOpenAL = mal_dlopen(libName);
#ifdef MAL_WIN32 for (size_t i = 0; i < mal_countof(libNames); ++i) {
// Special case for Win32 - try "soft_oal.dll" for OpenAL-Soft drop-ins. pContext->openal.hOpenAL = mal_dlopen(libNames[i]);
if (pContext->openal.hOpenAL == NULL) { if (pContext->openal.hOpenAL != NULL) {
pContext->openal.hOpenAL = mal_dlopen("soft_oal.dll"); break;
}
} }
#endif
if (pContext->openal.hOpenAL == NULL) { if (pContext->openal.hOpenAL == NULL) {
return MAL_FAILED_TO_INIT_BACKEND; return MAL_FAILED_TO_INIT_BACKEND;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment