[MPlayer-cvslog] r23446 - in trunk/loader: Makefile driver.c registry.c win32.c

diego subversion at mplayerhq.hu
Sat Jun 2 14:24:35 CEST 2007


Author: diego
Date: Sat Jun  2 14:24:35 2007
New Revision: 23446

Log:
Get rid of superfluous MPLAYER #define, it was always enabled and
cluttered the code. Blessed by Reimar.


Modified:
   trunk/loader/Makefile
   trunk/loader/driver.c
   trunk/loader/registry.c
   trunk/loader/win32.c

Modified: trunk/loader/Makefile
==============================================================================
--- trunk/loader/Makefile	(original)
+++ trunk/loader/Makefile	Sat Jun  2 14:24:35 2007
@@ -2,7 +2,7 @@ include ../config.mak
 
 LIBNAME_COMMON = libloader.a
 
-CFLAGS= -DMPLAYER -D__WINE__ -DNOAVIFILE_HEADERS
+CFLAGS= -D__WINE__ -DNOAVIFILE_HEADERS
 #CFLAGS+=-Ddbg_printf=__vprintf -DTRACE=__vprintf -DDETAILED_OUT
 
 SRCS_COMMON  = driver.c afl.c vfl.c

Modified: trunk/loader/driver.c
==============================================================================
--- trunk/loader/driver.c	(original)
+++ trunk/loader/driver.c	Sat Jun  2 14:24:35 2007
@@ -153,12 +153,10 @@ HDRVR DrvOpen(LPARAM lParam2)
     char unknown[0x124];
     const char* filename = (const char*) ((ICOPEN*) lParam2)->pV1Reserved;
 
-#ifdef MPLAYER
 #ifdef WIN32_LOADER
     Setup_LDT_Keeper();
 #endif
     printf("Loading codec DLL: '%s'\n",filename);
-#endif
 
     hDriver = (NPDRVR) malloc(sizeof(DRVR));
     if (!hDriver)

Modified: trunk/loader/registry.c
==============================================================================
--- trunk/loader/registry.c	(original)
+++ trunk/loader/registry.c	Sat Jun  2 14:24:35 2007
@@ -306,31 +306,8 @@ static void init_registry(void)
 	// can't be free-ed - it's static and probably thread
 	// unsafe structure which is stored in glibc
 
-#ifdef MPLAYER
 	regpathname = get_path("registry");
 	localregpathname = regpathname;
-#else
-	// regpathname is an external pointer
-        //
-	// registry.c is holding its own internal pointer
-	// localregpathname  - which is being allocate/deallocated
-
-	if (localregpathname == 0)
-	{
-            const char* pthn = regpathname;
-	    if (!regpathname)
-	    {
-		// avifile - for now reading data from user's home
-		struct passwd* pwent;
-		pwent = getpwuid(geteuid());
-                pthn = pwent->pw_dir;
-	    }
-
-	    localregpathname = malloc(strlen(pthn)+20);
-	    strcpy(localregpathname, pthn);
-	    strcat(localregpathname, "/.registry");
-	}
-#endif
 
 	open_registry();
 	insert_handle(HKEY_LOCAL_MACHINE, "HKLM");

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	(original)
+++ trunk/loader/win32.c	Sat Jun  2 14:24:35 2007
@@ -20,13 +20,11 @@ for DLL to know too much about its envir
 #include "config.h"
 #include "mangle.h"
 
-#ifdef MPLAYER
 #ifdef USE_QTX_CODECS
 #define QTX
 #endif
 #define REALPLAYER
 //#define LOADLIB_TRY_NATIVE
-#endif
 
 #ifdef QTX
 #define PSEUDO_SCREEN_WIDTH	/*640*/800
@@ -192,9 +190,7 @@ static void longcount_stub(long long* z)
     longcount(z);
 }
 
-#ifdef MPLAYER
 #include "mp_msg.h"
-#endif
 int LOADER_DEBUG=1; // active only if compiled with -DDETAILED_OUT
 //#define DETAILED_OUT
 static inline void dbgprintf(char* fmt, ...)
@@ -217,7 +213,6 @@ static inline void dbgprintf(char* fmt, 
 	va_end(va);
     }
 #endif
-#ifdef MPLAYER
     if ( mp_msg_test(MSGT_WIN32,MSGL_DBG3) )
     {
 	va_list va;
@@ -228,7 +223,6 @@ static inline void dbgprintf(char* fmt, 
 	va_end(va);
     }
   fflush(stdout);
-#endif
 }
 
 
@@ -960,7 +954,6 @@ static void WINAPI expGetSystemInfo(SYST
     cachedsi.wProcessorLevel		= 5; /* pentium */
     cachedsi.wProcessorRevision		= 0x0101;
 
-#ifdef MPLAYER
     /* mplayer's way to detect PF's */
     {
 #include "cpudetect.h"
@@ -993,41 +986,6 @@ static void WINAPI expGetSystemInfo(SYST
 	    cachedsi.wProcessorRevision = gCpuCaps.cpuStepping;
     	    cachedsi.dwNumberOfProcessors = 1;	/* hardcoded */
     }
-#endif
-
-/* disable cpuid based detection (mplayer's cpudetect.c does this - see above) */
-#ifndef MPLAYER
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__) || defined(__DragonFly__)
-    do_cpuid(1, regs);
-    switch ((regs[0] >> 8) & 0xf) {			// cpu family
-    case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
-    cachedsi.wProcessorLevel= 3;
-    break;
-    case 4: cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
-    cachedsi.wProcessorLevel= 4;
-    break;
-    case 5: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-    cachedsi.wProcessorLevel= 5;
-    break;
-    case 6: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-    cachedsi.wProcessorLevel= 5;
-    break;
-    default:cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-    cachedsi.wProcessorLevel= 5;
-    break;
-    }
-    cachedsi.wProcessorRevision = regs[0] & 0xf;	// stepping
-    if (regs[3] & (1 <<  8))
-	PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
-    if (regs[3] & (1 << 23))
-	PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
-    if (regs[3] & (1 << 25))
-	PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
-    if (regs[3] & (1 << 31))
-	PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
-    cachedsi.dwNumberOfProcessors=1;
-#endif
-#endif /* MPLAYER */
 
 /* MPlayer: linux detection enabled (based on proc/cpuinfo) for checking
    fdiv_bug and fpu emulation flags -- alex/MPlayer */
@@ -1039,11 +997,9 @@ static void WINAPI expGetSystemInfo(SYST
 
 	if (!f)
 	{
-#ifdef MPLAYER
 	  mp_msg(MSGT_WIN32, MSGL_WARN, "expGetSystemInfo: "
 	                     "/proc/cpuinfo not readable! "
 	                     "Expect bad performance and/or weird behaviour\n");
-#endif
 	  goto exit;
 	}
 	while (fgets(line,200,f)!=NULL) {
@@ -5080,9 +5036,7 @@ struct exports exp_msvcrt[]={
 /* needed by frapsvid.dll */
     {"strstr",-1,(char *)&strstr},
     {"qsort",-1,(void *)&qsort},
-#ifdef MPLAYER
     FF(_EH_prolog,-1)
-#endif
     FF(calloc,-1)
     {"ceil",-1,(void*)&ceil},
 /* needed by imagepower mjpeg2k */



More information about the MPlayer-cvslog mailing list