[MPlayer-cvslog] CVS: main mencoder.c, 1.310, 1.311 mplayer.c, 1.877, 1.878 get_path.c, 1.10, 1.11

Sascha Sommer CVS syncmail at mplayerhq.hu
Sun Oct 16 21:14:11 CEST 2005


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv27798

Modified Files:
	mencoder.c mplayer.c get_path.c 
Log Message:
allow mencoder to load win32 codecs properly patch by Zuxy <zuxy.meng at gmail.com>

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -r1.310 -r1.311
--- mencoder.c	13 Oct 2005 20:54:21 -0000	1.310
+++ mencoder.c	16 Oct 2005 19:14:08 -0000	1.311
@@ -437,6 +437,10 @@
   mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
 #endif
 #endif
+
+#if defined(WIN32) && defined(USE_WIN32DLL)
+  set_path_env();
+#endif /*WIN32 && USE_WIN32DLL*/
   
   InitTimer();
 

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.877
retrieving revision 1.878
diff -u -r1.877 -r1.878
--- mplayer.c	13 Oct 2005 22:41:30 -0000	1.877
+++ mplayer.c	16 Oct 2005 19:14:08 -0000	1.878
@@ -1119,35 +1119,7 @@
 #endif /* defined(ARCH_X86) || defined(ARCH_X86_64) */
 
 #if defined(WIN32) && defined(USE_WIN32DLL)
-{  /*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
-  if(!strstr(WIN32_PATH,":")){
-    GetModuleFileNameA(NULL, win32path, MAX_PATH);
-    strcpy(win32path + strlen(win32path) - strlen("mplayer.exe"), WIN32_PATH);
-  }
-  else strcpy(win32path,WIN32_PATH);
-  strcpy(tmppath,win32path);
-#ifdef USE_REALCODECS
-  if(!strstr(REALCODEC_PATH,":")){
-    GetModuleFileNameA(NULL, realpath, MAX_PATH);
-    strcpy(realpath + strlen(realpath) - strlen("mplayer.exe"), REALCODEC_PATH);
-  }
-  else strcpy(realpath,REALCODEC_PATH);
-  sprintf(tmppath,"%s;%s",win32path,realpath);
-#endif /*USE_REALCODECS*/
-#endif /*__CYGWIN__*/
-  SetEnvironmentVariableA("PATH", tmppath);
-}
+  set_path_env();
 #endif /*WIN32 && USE_WIN32DLL*/
 
 #ifdef USE_TV

Index: get_path.c
===================================================================
RCS file: /cvsroot/mplayer/main/get_path.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- get_path.c	3 Jun 2005 14:52:15 -0000	1.10
+++ get_path.c	16 Oct 2005 19:14:09 -0000	1.11
@@ -104,3 +104,41 @@
 	mp_msg(MSGT_GLOBAL,MSGL_V,"get_path('%s') -> '%s'\n",filename,buff);
 	return buff;
 }
+
+#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__*/
+	/* Expand to absolute path unless 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
+	/* 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 /*USE_REALCODECS*/
+#endif /*__CYGWIN__*/
+	mp_msg(MSGT_WIN32, MSGL_V,"Setting PATH to %s\n",tmppath);
+	if (!SetEnvironmentVariableA("PATH", tmppath))
+		mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!");
+}
+#endif /*WIN32 && USE_WIN32DLL*/




More information about the MPlayer-cvslog mailing list