# HG changeset patch # User faust3 # Date 1105995468 0 # Node ID 860f06087aac9bba2a8b87ae1c4f315a1ee28235 # Parent 5417ab15e90093229f8d418f8dd5b0af817102d4 preload quicktime.qts, this allows us to ignore the hardcoded path inside the dlls so that quicktime.qts doesn't need to be in the windows system dir, patch by Gianluigi Tiesi , comments by myself diff -r 5417ab15e900 -r 860f06087aac libmpcodecs/ad_qtaudio.c --- a/libmpcodecs/ad_qtaudio.c Mon Jan 17 17:27:39 2005 +0000 +++ b/libmpcodecs/ad_qtaudio.c Mon Jan 17 20:57:48 2005 +0000 @@ -68,6 +68,7 @@ unsigned long *outputBytes); typedef int (__cdecl* LPFUNC9)(SoundConverter sc) ; +static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts static HINSTANCE qtml_dll; static LPFUNC1 InitializeQTML; static LPFUNC2 SoundConverterOpen; @@ -91,10 +92,17 @@ #ifdef WIN32_LOADER Setup_LDT_Keeper(); #endif + //preload quicktime.qts to avoid the problems caused by the hardcoded path inside the dll + qtime_qts = LoadLibraryA("QuickTime.qts"); + if( qtime_qts == (HMODULE)NULL ) + { + mp_msg(MSGT_DECAUDIO,MSGL_ERR,"failed loading QuickTime.qts\n" ); + return 1; + } qtml_dll = LoadLibraryA("qtmlClient.dll"); if( qtml_dll == (HMODULE)NULL ) { - mp_msg(MSGT_DECAUDIO,MSGL_ERR,"failed loading dll\n" ); + mp_msg(MSGT_DECAUDIO,MSGL_ERR,"failed loading qtmlClient.dll\n" ); return 1; } #if 1 @@ -269,6 +277,8 @@ // printf("TerminateQTML:%i\n",error); // FreeLibrary( qtml_dll ); // qtml_dll = NULL; +// FreeLibrary( qtime_qts ); +// qtime_qts = NULL; // printf("qt dll loader uninit done\n"); #ifdef MACOSX ExitMovies(); diff -r 5417ab15e900 -r 860f06087aac libmpcodecs/vd_qtvideo.c --- a/libmpcodecs/vd_qtvideo.c Mon Jan 17 17:27:39 2005 +0000 +++ b/libmpcodecs/vd_qtvideo.c Mon Jan 17 20:57:48 2005 +0000 @@ -52,7 +52,7 @@ static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment static ImageDescriptionHandle framedescHandle; -//static HINSTANCE qtml_dll; +static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts static HMODULE handler; #if defined(USE_QTX_CODECS) && !defined(MACOSX) @@ -116,6 +116,13 @@ Setup_LDT_Keeper(); #endif + //preload quicktime.qts to avoid the problems caused by the hardcoded path inside the dll + qtime_qts = LoadLibraryA("QuickTime.qts"); + if(!qtime_qts){ + mp_msg(MSGT_DECVIDEO,MSGL_ERR,"unable to load QuickTime.qts\n" ); + return 0; + } + handler = LoadLibraryA("qtmlClient.dll"); if(!handler){ mp_msg(MSGT_DECVIDEO,MSGL_ERR,"unable to load qtmlClient.dll\n"); diff -r 5417ab15e900 -r 860f06087aac libmpcodecs/ve_qtvideo.c --- a/libmpcodecs/ve_qtvideo.c Mon Jan 17 17:27:39 2005 +0000 +++ b/libmpcodecs/ve_qtvideo.c Mon Jan 17 20:57:48 2005 +0000 @@ -34,6 +34,7 @@ HMODULE WINAPI LoadLibraryA(LPCSTR); FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); int WINAPI FreeLibrary(HMODULE); +static HINSTANCE qtime_qts; //handle to preloaded quicktime.qts static HMODULE handler; static OSErr (*FindCodec)(CodecType cType, @@ -296,6 +297,13 @@ #ifdef WIN32_LOADER Setup_LDT_Keeper(); #endif + //preload quicktime.qts to avoid the problems caused by the hardcoded path inside the dll + qtime_qts = LoadLibraryA("QuickTime.qts"); + if(!qtime_qts){ + mp_msg(MSGT_MENCODER,MSGL_ERR,"unable to load QuickTime.qts\n" ); + return 0; + } + handler = LoadLibraryA("qtmlClient.dll"); if(!handler){ mp_msg(MSGT_MENCODER,MSGL_ERR,"unable to load qtmlClient.dll\n");