coreaudio-encoder: Actually fix coreaudio loading

Apparently using LoadLibrary on a full path doesn't work -- you need to
use SetDllDirectory before loading a library.
This commit is contained in:
jp9000 2020-10-06 07:50:38 -07:00
parent 50cbafd711
commit e1a0c60735

View File

@ -376,11 +376,13 @@ static bool load_from_shell_path(REFKNOWNFOLDERID rfid, const wchar_t *subpath)
}
wchar_t path[MAX_PATH];
_snwprintf(path, MAX_PATH, L"%s\\%s\\%s", sh_path, subpath,
L"CoreAudioToolbox.dll");
_snwprintf(path, MAX_PATH, L"%s\\%s", sh_path, subpath);
CoTaskMemFree(sh_path);
audio_toolbox = LoadLibraryW(path);
SetDllDirectory(path);
audio_toolbox = LoadLibraryW(L"CoreAudioToolbox.dll");
SetDllDirectory(nullptr);
return !!audio_toolbox;
}