FFmpegDL: Added external_dlls folder to user folder

AACDecoder: addressed reviews
This commit is contained in:
B3N30
2019-02-09 11:52:31 +01:00
parent 45b5de7a18
commit 847003cc1c
5 changed files with 27 additions and 18 deletions
+7 -4
View File
@@ -6,8 +6,9 @@
#ifdef _WIN32
#include <windows.h>
#endif // _WIN32
#endif // _WIN32
#include "common/file_util.h"
#include "common/logging/log.h"
extern "C" {
@@ -20,9 +21,8 @@ template <typename T>
struct FuncDL {
FuncDL() = default;
FuncDL(HMODULE dll, const char* name) {
ptr_function = nullptr;
if (dll) {
*(void**)&ptr_function = (void*)GetProcAddress(dll, name);
ptr_function = reinterpret_cast<T*>(GetProcAddress(dll, name));
}
}
@@ -35,7 +35,6 @@ struct FuncDL {
}
T* ptr_function = nullptr;
;
};
FuncDL<int(AVSampleFormat)> av_get_bytes_per_sample_dl;
@@ -56,6 +55,10 @@ FuncDL<int(AVCodecParserContext*, AVCodecContext*, uint8_t**, int*, const uint8_
FuncDL<void(AVCodecParserContext*)> av_parser_close_dl;
bool InitFFmpegDL() {
FileUtil::CreateDir(FileUtil::GetUserPath(FileUtil::UserPath::DLLDir));
SetDllDirectoryA(FileUtil::GetUserPath(FileUtil::UserPath::DLLDir).c_str());
HMODULE dll_util = nullptr;
dll_util = LoadLibrary("avutil-56.dll");
if (!dll_util) {