[MPlayer-cvslog] r30888 - in trunk: configure get_path.c libmpcodecs/ad_realaud.c libmpcodecs/vd_realvid.c libmpcodecs/vd_xanim.c loader/drv.c loader/win32.c

diego subversion at mplayerhq.hu
Sun Mar 14 17:13:32 CET 2010


Author: diego
Date: Sun Mar 14 17:13:32 2010
New Revision: 30888

Log:
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.

Modified:
   trunk/configure
   trunk/get_path.c
   trunk/libmpcodecs/ad_realaud.c
   trunk/libmpcodecs/vd_realvid.c
   trunk/libmpcodecs/vd_xanim.c
   trunk/loader/drv.c
   trunk/loader/win32.c

Modified: trunk/configure
==============================================================================
--- trunk/configure	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/configure	Sun Mar 14 17:13:32 2010	(r30888)
@@ -218,9 +218,6 @@ Installation directories:
                          [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 @@ for ac_option do
   --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 @@ if test "$_win32dll" = auto ; then
 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 @@ if test "$_xanim" = auto ; then
   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 @@ if test "$_real" = auto ; then
   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_libnut
 $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"
 
 

Modified: trunk/get_path.c
==============================================================================
--- trunk/get_path.c	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/get_path.c	Sun Mar 14 17:13:32 2010	(r30888)
@@ -161,31 +161,17 @@ void set_path_env(void)
 	/*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))

Modified: trunk/libmpcodecs/ad_realaud.c
==============================================================================
--- trunk/libmpcodecs/ad_realaud.c	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/libmpcodecs/ad_realaud.c	Sun Mar 14 17:13:32 2010	(r30888)
@@ -251,9 +251,9 @@ static int preinit(sh_audio_t *sh){
   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 @@ static int preinit(sh_audio_t *sh){
   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 @@ static int preinit(sh_audio_t *sh){
 #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){

Modified: trunk/libmpcodecs/vd_realvid.c
==============================================================================
--- trunk/libmpcodecs/vd_realvid.c	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/libmpcodecs/vd_realvid.c	Sun Mar 14 17:13:32 2010	(r30888)
@@ -273,9 +273,9 @@ static int init(sh_video_t *sh){
 
 	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 */

Modified: trunk/libmpcodecs/vd_xanim.c
==============================================================================
--- trunk/libmpcodecs/vd_xanim.c	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/libmpcodecs/vd_xanim.c	Sun Mar 14 17:13:32 2010	(r30888)
@@ -664,7 +664,7 @@ static int control(sh_video_t *sh,int cm
 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;

Modified: trunk/loader/drv.c
==============================================================================
--- trunk/loader/drv.c	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/loader/drv.c	Sun Mar 14 17:13:32 2010	(r30888)
@@ -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 @@ void SetCodecPath(const char* path)
     if(needs_free)free(def_path);
     if(path==0)
     {
-	def_path=WIN32_PATH;
+	def_path = BINARY_CODECS_PATH;
 	needs_free=0;
 	return;
     }

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	Sat Mar 13 23:46:58 2010	(r30887)
+++ trunk/loader/win32.c	Sun Mar 14 17:13:32 2010	(r30888)
@@ -77,7 +77,7 @@ for DLL to know too much about its envir
 #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)
 {


More information about the MPlayer-cvslog mailing list