Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2013-01-11 20:38:31 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2013-01-11 20:38:31 +0400
commit6401f114a8b0b34f595d37e79bb65563b4493503 (patch)
tree23c4f1f2215cc646ed31d90af19e05379f888e11 /decoder
parentb89d2bb35a11e1d2303acd007a99a5a21f06992a (diff)
Revert "Avoid using SetDllDirectory"
This reverts commit c957a583384192caaa5e5db466d9ee525e59fbf5. Using absolute paths to the DLLs seems to cause issues for some people, so until this can be properly diagnosed and fixed, return to SetDllDirectory. Fixes issue 311
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVAudio/DTSDecoder.cpp15
-rw-r--r--decoder/LAVVideo/decoders/quicksync.cpp6
2 files changed, 7 insertions, 14 deletions
diff --git a/decoder/LAVAudio/DTSDecoder.cpp b/decoder/LAVAudio/DTSDecoder.cpp
index 836bad70..f3100ada 100644
--- a/decoder/LAVAudio/DTSDecoder.cpp
+++ b/decoder/LAVAudio/DTSDecoder.cpp
@@ -76,21 +76,16 @@ struct DTSDecoder {
HRESULT CLAVAudio::InitDTSDecoder()
{
if (!m_hDllExtraDecoder) {
+ // Add path of LAVAudio.ax into the Dll search path
WCHAR wModuleFile[1024];
GetModuleFileName(g_hInst, wModuleFile, 1024);
PathRemoveFileSpecW(wModuleFile);
+ SetDllDirectory(wModuleFile);
- wcscat_s(wModuleFile, TEXT("\\"));
- wcscat_s(wModuleFile, TEXT("dtsdecoderdll.dll"));
+ HMODULE hDll = LoadLibrary(TEXT("dtsdecoderdll.dll"));
+ CheckPointer(hDll, E_FAIL);
- // Try loading from the LAV directory
- m_hDllExtraDecoder = LoadLibrary(wModuleFile);
-
- // And if this failed, from the system directories
- if (m_hDllExtraDecoder == NULL)
- m_hDllExtraDecoder = LoadLibrary(TEXT("dtsdecoderdll.dll"));
-
- CheckPointer(m_hDllExtraDecoder, E_FAIL);
+ m_hDllExtraDecoder = hDll;
}
DTSDecoder *context = new DTSDecoder();
diff --git a/decoder/LAVVideo/decoders/quicksync.cpp b/decoder/LAVVideo/decoders/quicksync.cpp
index 4f8b5bb0..e3f7a0be 100644
--- a/decoder/LAVVideo/decoders/quicksync.cpp
+++ b/decoder/LAVVideo/decoders/quicksync.cpp
@@ -262,11 +262,9 @@ STDMETHODIMP CDecQuickSync::Init()
WCHAR wModuleFile[1024];
GetModuleFileName(g_hInst, wModuleFile, 1024);
PathRemoveFileSpecW(wModuleFile);
+ SetDllDirectory(wModuleFile);
- wcscat_s(wModuleFile, TEXT("\\"));
- wcscat_s(wModuleFile, TEXT(QS_DEC_DLL_NAME));
-
- qs.quickSyncLib = LoadLibrary(wModuleFile);
+ qs.quickSyncLib = LoadLibrary(TEXT(QS_DEC_DLL_NAME));
if (qs.quickSyncLib == NULL) {
DWORD dwError = GetLastError();
DbgLog((LOG_ERROR, 10, L"-> Loading of " TEXT(QS_DEC_DLL_NAME) L" failed (%d)", dwError));