[Mplayer-cvslog] CVS: main/loader win32.c,1.48,1.49

Alex Beregszaszi alex at mplayerhq.hu
Sun Apr 21 01:11:25 CEST 2002


Update of /cvsroot/mplayer/main/loader
In directory mail:/var/tmp.root/cvs-serv6339

Modified Files:
	win32.c 
Log Message:
fixed mp_msg, fixed CreateFile for VDub, added GetFullPathName for VDub, cleaned up a bit the critisecs

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- win32.c	20 Mar 2002 22:32:17 -0000	1.48
+++ win32.c	20 Apr 2002 23:11:22 -0000	1.49
@@ -187,19 +187,11 @@
 	va_end(va);
     }
 #endif
-#if 0
-// al3x: it break divx audio. btw it should be if(verbose>2){ ... } anyway...
-// #ifdef MPLAYER
+#undef MPLAYER
+#ifdef MPLAYER
     #include "../mp_msg.h"
-    {
-	char buf[1024];
-	va_list va;
-
-        va_start(va, fmt);
-	vsnprintf((char *)&buf[0], 1023, fmt, va);
-	mp_dbg(MSGT_WIN32, MSGL_DBG3, (char *)&buf[0]);
-	va_end(va);
-    }
+    if (verbose > 2) 
+	mp_dbg(MSGT_WIN32, MSGL_DBG3, fmt, va);
 #endif
 }
 
@@ -1210,7 +1202,7 @@
 	    printf("InitializeCriticalSection(%p) - no more space in list\n", c);
 	    return;
 	}
-	printf("got unused space at %d\n", i);
+	dbgprintf("got unused space at %d\n", i);
 	cs = expmalloc(sizeof(struct CRITSECT));
 	if (!cs)
 	{
@@ -1245,7 +1237,7 @@
     dbgprintf("EnterCriticalSection(0x%x)\n",c);
     if (!cs)
     {
-	printf("entered uninitialized critisec!\n");
+	dbgprintf("entered uninitialized critisec!\n");
 	expInitializeCriticalSection(c);
 #ifdef CRITSECS_NEWTYPE
 	cs=critsecs_get_unix(c);
@@ -1273,7 +1265,7 @@
     dbgprintf("LeaveCriticalSection(0x%x)\n",c);
     if (!cs)
     {
-	printf("Win32 Warning: Leaving noninitialized Critical Section %p!!\n", c);
+	printf("Win32 Warning: Leaving uninitialized Critical Section %p!!\n", c);
 	return;
     }
     cs->locked=0;
@@ -1326,7 +1318,7 @@
 
 extern void* fs_seg;
 
-#if 0
+#if 1
 // this version is required for Quicktime codecs (.qtx/.qts) to work.
 // (they assume some pointers at FS: segment)
 
@@ -1967,6 +1959,10 @@
 static int WINAPI expCloseHandle(long v1)
 {
     dbgprintf("CloseHandle(0x%x) => 1\n", v1);
+    /* do not close stdin,stdout and stderr */
+    if (v1 > 2)
+	if (!close(v1))
+	    return 0;
     return 1;
 }
 
@@ -2949,6 +2945,23 @@
 	return r;
     }
 
+#if 0
+    /* we need this for some virtualdub filters */  
+    {
+	int r;
+	int flg = 0;
+	if (GENERIC_READ & i1)
+	    flg |= O_RDONLY;
+	else if (GENERIC_WRITE & i1)
+	{
+	    flg |= O_WRONLY;
+	    printf("Warning: openning filename %s  %d (flags; 0x%x) for write\n", cs1, r, flg);
+	}
+	r=open(cs1, flg);
+	return r;
+    }    
+#endif
+
     return atoi(cs1+2);
 }
 static UINT WINAPI expGetSystemDirectoryA(
@@ -2967,6 +2980,22 @@
     return sysdir;
 }
 */
+static DWORD WINAPI expGetFullPathNameA
+(
+	LPCTSTR lpFileName,
+	DWORD nBufferLength,
+	LPTSTR lpBuffer,
+	LPTSTR lpFilePart
+){
+    if(!lpFileName) return 0;
+    dbgprintf("GetFullPathNameA('%s',%d,%p,%p)\n",lpFileName,nBufferLength,
+	lpBuffer, lpFilePart);
+    strcpy(lpFilePart, lpFileName);
+    strcpy(lpBuffer, lpFileName);
+//    strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName);
+    return strlen(lpBuffer);
+}
+
 static DWORD WINAPI expGetShortPathNameA
 (
         LPCSTR longpath,
@@ -3801,6 +3830,7 @@
     FF(GetSystemDirectoryA,-1)
     FF(GetWindowsDirectoryA,-1)
     FF(GetShortPathNameA,-1)
+    FF(GetFullPathNameA,-1)
     FF(SetErrorMode, -1)
     FF(IsProcessorFeaturePresent, -1)
     FF(GetProcessAffinityMask, -1)




More information about the MPlayer-cvslog mailing list