# HG changeset patch # User diego # Date 1268583212 0 # Node ID 72ae3dd3aa6ec14357a2691181abebd2426e5aca # Parent ab30cba9b0379aece7695c4841c407a7fb4d05d3 Replace separate Win32, XAnim and Real codec directories by one global dir. Nowadays MPlayer does not use the codecs from other installed programs. A runtime setting will soon take over the rare case that binary codecs should be searched for in non-standard directories. diff -r ab30cba9b037 -r 72ae3dd3aa6e configure --- a/configure Sat Mar 13 22:46:58 2010 +0000 +++ b/configure Sun Mar 14 16:13:32 2010 +0000 @@ -218,9 +218,6 @@ [PREFIX/etc/mplayer] --libdir=DIR directory for object code libraries [PREFIX/lib] --codecsdir=DIR directory for binary codecs [LIBDIR/codecs] - --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs] - --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs] - --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs] Optional features: --disable-mencoder disable MEncoder (A/V encoder) compilation [enable] @@ -791,15 +788,6 @@ --codecsdir=*) _codecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; - --win32codecsdir=*) - _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --xanimcodecsdir=*) - _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --realcodecsdir=*) - _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2) - ;; --with-install=*) _install=$(echo $ac_option | cut -d '=' -f 2 ) @@ -7063,8 +7051,6 @@ fi if test "$_win32dll" = yes ; then def_win32dll='#define CONFIG_WIN32DLL 1' - test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir - _res_comment="using $_win32codecsdir" if ! win32 ; then def_win32_loader='#define WIN32_LOADER 1' _win32_emulation=yes @@ -7090,14 +7076,10 @@ fi fi if test "$_xanim" = yes ; then - test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir def_xanim='#define CONFIG_XANIM 1' - def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\"" _codecmodules="xanim $_codecmodules" - _res_comment="using $_xanimcodecsdir" else def_xanim='#undef CONFIG_XANIM' - def_xanim_path='#undef XACODEC_PATH' _nocodecmodules="xanim $_nocodecmodules" fi echores "$_xanim" @@ -7113,14 +7095,10 @@ fi fi if test "$_real" = yes ; then - test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir" def_real='#define CONFIG_REALCODECS 1' - def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\"" _codecmodules="real $_codecmodules" - _res_comment="using $_realcodecsdir" else def_real='#undef CONFIG_REALCODECS' - def_real_path="#undef REALCODEC_PATH" _nocodecmodules="real $_nocodecmodules" fi echores "$_real" @@ -8989,13 +8967,11 @@ $def_qtx $def_qtx_win32 $def_real -$def_real_path $def_win32_loader $def_win32dll -#define WIN32_PATH "$_win32codecsdir" $def_xanim -$def_xanim_path $def_xmms +#define BINARY_CODECS_PATH "$_codecsdir" #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir" diff -r ab30cba9b037 -r 72ae3dd3aa6e get_path.c --- a/get_path.c Sat Mar 13 22:46:58 2010 +0000 +++ b/get_path.c Sun Mar 14 16:13:32 2010 +0000 @@ -161,31 +161,17 @@ /*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); + cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); strcpy(tmppath,win32path); -#ifdef CONFIG_REALCODECS - cygwin_conv_to_full_win32_path(REALCODEC_PATH,realpath); - sprintf(tmppath,"%s;%s",win32path,realpath); -#endif /*CONFIG_REALCODECS*/ #else /*__CYGWIN__*/ /* Expand to absolute path unless it's already absolute */ - if (!strstr(WIN32_PATH,":") && WIN32_PATH[0] != '\\'){ + if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { GetModuleFileNameA(NULL, win32path, MAX_PATH); - strcpy(strrchr(win32path, '\\') + 1, WIN32_PATH); + strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); } - else strcpy(win32path,WIN32_PATH); + else strcpy(win32path, BINARY_CODECS_PATH); strcpy(tmppath,win32path); -#ifdef CONFIG_REALCODECS - /* Expand to absolute path unless 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 /*CONFIG_REALCODECS*/ #endif /*__CYGWIN__*/ mp_msg(MSGT_WIN32, MSGL_V,"Setting PATH to %s\n",tmppath); if (!SetEnvironmentVariableA("PATH", tmppath)) diff -r ab30cba9b037 -r 72ae3dd3aa6e libmpcodecs/ad_realaud.c --- a/libmpcodecs/ad_realaud.c Sat Mar 13 22:46:58 2010 +0000 +++ b/libmpcodecs/ad_realaud.c Sun Mar 14 16:13:32 2010 +0000 @@ -251,9 +251,9 @@ unsigned int result; char *path; - path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2); + path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2); if (!path) return 0; - sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll); + sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll); /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ @@ -277,8 +277,8 @@ if(raSetDLLAccessPath){ #endif // used by 'SIPR' - path = realloc(path, strlen(REALCODEC_PATH) + 13); - sprintf(path, "DT_Codecs=" REALCODEC_PATH); + path = realloc(path, strlen(BINARY_CODECS_PATH) + 13); + sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH); if(path[strlen(path)-1]!='/'){ path[strlen(path)+1]=0; path[strlen(path)]='/'; @@ -300,13 +300,13 @@ #ifdef CONFIG_WIN32DLL if (dll_type == 1){ if(wraOpenCodec2) - result=wraOpenCodec2(&sh->context,REALCODEC_PATH "\\"); + result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\"); else result=wraOpenCodec(&sh->context); } else #endif if(raOpenCodec2) - result=raOpenCodec2(&sh->context,REALCODEC_PATH "/"); + result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/"); else result=raOpenCodec(&sh->context); if(result){ diff -r ab30cba9b037 -r 72ae3dd3aa6e libmpcodecs/vd_realvid.c --- a/libmpcodecs/vd_realvid.c Sat Mar 13 22:46:58 2010 +0000 +++ b/libmpcodecs/vd_realvid.c Sun Mar 14 16:13:32 2010 +0000 @@ -273,9 +273,9 @@ mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",be2me_32(((unsigned int*)extrahdr)[1]),be2me_32(((unsigned int*)extrahdr)[0])); - path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2); + path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2); if (!path) return 0; - sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll); + sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll); /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ diff -r ab30cba9b037 -r 72ae3dd3aa6e libmpcodecs/vd_xanim.c --- a/libmpcodecs/vd_xanim.c Sat Mar 13 22:46:58 2010 +0000 +++ b/libmpcodecs/vd_xanim.c Sun Mar 14 16:13:32 2010 +0000 @@ -664,7 +664,7 @@ static int init(sh_video_t *sh) { vd_xanim_ctx *priv; - char *def_path = XACODEC_PATH; + char *def_path = BINARY_CODECS_PATH; char dll[1024]; XA_CODEC_HDR codec_hdr; int i; diff -r ab30cba9b037 -r 72ae3dd3aa6e loader/drv.c --- a/loader/drv.c Sat Mar 13 22:46:58 2010 +0000 +++ b/loader/drv.c Sun Mar 14 16:13:32 2010 +0000 @@ -27,7 +27,7 @@ #endif #ifndef WIN32_LOADER -char* def_path=WIN32_PATH; +char* def_path = BINARY_CODECS_PATH; #else extern char* def_path; #endif @@ -71,7 +71,7 @@ if(needs_free)free(def_path); if(path==0) { - def_path=WIN32_PATH; + def_path = BINARY_CODECS_PATH; needs_free=0; return; } diff -r ab30cba9b037 -r 72ae3dd3aa6e loader/win32.c --- a/loader/win32.c Sat Mar 13 22:46:58 2010 +0000 +++ b/loader/win32.c Sun Mar 14 16:13:32 2010 +0000 @@ -77,7 +77,7 @@ #include "osdep/mmap_anon.h" #include "libavutil/avstring.h" -char* def_path = WIN32_PATH; +char* def_path = BINARY_CODECS_PATH; static void do_cpuid(unsigned int ax, unsigned int *regs) {