[MPlayer-dev-eng] [PATCH] mencoder to load win32 codecs properly
Zuxy
zuxy.meng at gmail.com
Tue Oct 11 14:59:48 CEST 2005
2005/10/11, Guillaume POIRIER <poirierg at gmail.com>:
> Hi,
>
> I don't quite see how you'd do this...
Sorry it should be strrchs(win32path, '\\')
>
> That'd be a much better idea IMHO. What do you propose to do it?
>
Some function like
/*-----------------------------------------------------------------------------------------------*/
#if defined(WIN32) && defined(USE_WIN32DLL)
void set_path_env()
{ /*make our codec dirs available for LoadLibraryA()*/
char tmppath[MAX_PATH*2 + 1];
char win32path[MAX_PATH];
char realpath[MAX_PATH];
#ifdef __CYGWIN__
cygwin_conv_to_full_win32_path(WIN32_PATH,win32path);
strcpy(tmppath,win32path);
#ifdef USE_REALCODECS
cygwin_conv_to_full_win32_path(REALCODEC_PATH,realpath);
sprintf(tmppath,"%s;%s",win32path,realpath);
#endif /*USE_REALCODECS*/
#else /*__CYGWIN__*/
/* Do not expand to absolute path if it's already absolute */
if(!strstr(WIN32_PATH,":") && WIN32_PATH[0] != '\\'){
GetModuleFileNameA(NULL, win32path, MAX_PATH);
strcpy(strrchr(win32path, '\\') + 1, WIN32_PATH);
}
else strcpy(win32path,WIN32_PATH);
strcpy(tmppath,win32path);
#ifdef USE_REALCODECS
/* Do not expand to absolute path if it's already absolute */
if(!strstr(REALCODEC_PATH,":") && REALCODEC_PATH[0] != '\\'){
GetModuleFileNameA(NULL, realpath, MAX_PATH);
strcpy(strrchr(realpath, '\\') + 1, REALCODEC_PATH);
}
else strcpy(realpath,REALCODEC_PATH);
sprintf(tmppath,"%s;%s",win32path,realpath);
#endif /*USE_REALCODECS*/
#endif /*__CYGWIN__*/
SetEnvironmentVariableA("PATH", tmppath);
}
#endif /*WIN32 && USE_WIN32DLL*/
/*--------------------------------------------------------------------------------------*/
in get_path.c??
--
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
More information about the MPlayer-dev-eng
mailing list