XAudio : reorder versioning 2.9>2.7>2.8 (#2048)

This commit is contained in:
raven02 2016-08-09 15:55:11 +08:00 committed by GitHub
parent 44ae306e6b
commit 009ac37a7d

View File

@ -13,6 +13,22 @@ XAudio2Thread::XAudio2Thread()
LOG_ERROR(GENERAL, "XAudio: failed to increase thread priority");
}
if (auto lib2_9 = LoadLibraryExW(L"XAudio2_9.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32))
{
// xa28* implementation is fully compatible with library 2.9
xa28_init(lib2_9);
m_funcs.destroy = &xa28_destroy;
m_funcs.play = &xa28_play;
m_funcs.flush = &xa28_flush;
m_funcs.stop = &xa28_stop;
m_funcs.open = &xa28_open;
m_funcs.add = &xa28_add;
LOG_SUCCESS(GENERAL, "XAudio 2.9 initialized");
return;
}
if (auto lib2_7 = LoadLibraryExW(L"XAudio2_7.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32))
{
xa27_init(lib2_7);
@ -28,22 +44,6 @@ XAudio2Thread::XAudio2Thread()
return;
}
if (auto lib2_9 = LoadLibraryExW(L"XAudio2_9.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32))
{
// xa28* implementation is fully compatible with library 2.9
xa28_init(lib2_9);
m_funcs.destroy = &xa28_destroy;
m_funcs.play = &xa28_play;
m_funcs.flush = &xa28_flush;
m_funcs.stop = &xa28_stop;
m_funcs.open = &xa28_open;
m_funcs.add = &xa28_add;
LOG_SUCCESS(GENERAL, "XAudio 2.9 initialized");
return;
}
if (auto lib2_8 = LoadLibraryExW(L"XAudio2_8.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32))
{
xa28_init(lib2_8);