[MPlayer-dev-eng] [PATCH] make wmv9 playback less verbose

Diego Biurrun diego at biurrun.de
Fri Mar 26 03:54:19 CET 2004


Hi!

When playin wmv9 videos the console gets spammed badly with messages
like this:

  Win32 Warning: Unlocking unlocked Critical Section 0x864fb18!!

These messages are more confusing than helpful and they come by the
hundreds, which makes them annoying.  This patch changes the printf
calls to dbgprintf calls, which makes the messages appear only when
mplayer is called with -v -v.

IIRC there have been complaints about these messages on -users and
here also.  I'd like to commit this, if there are no problems, so
somebody please check it.

Diego


Index: loader/win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.85
diff -u -r1.85 win32.c
--- loader/win32.c	23 Mar 2004 20:08:28 -0000	1.85
+++ loader/win32.c	26 Mar 2004 02:47:48 -0000
@@ -1350,7 +1350,7 @@
 #else
 	cs = (*(struct CRITSECT**)c);
 #endif
-	printf("Win32 Warning: Accessed uninitialized Critical Section (%p)!\n", c);
+	dbgprintf("Win32 Warning: Accessed uninitialized Critical Section (%p)!\n", c);
     }
     if(cs->locked)
 	if(cs->id==pthread_self())
@@ -1371,7 +1371,7 @@
     dbgprintf("LeaveCriticalSection(0x%x) 0x%x\n",c, cs);
     if (!cs)
     {
-	printf("Win32 Warning: Leaving uninitialized Critical Section %p!!\n", c);
+	dbgprintf("Win32 Warning: Leaving uninitialized Critical Section %p!!\n", c);
 	return;
     }
     if (cs->locked)
@@ -1380,7 +1380,7 @@
 	pthread_mutex_unlock(&(cs->mutex));
     }
     else
-	printf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c);
+	dbgprintf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c);
     return;
 }
 
@@ -1398,13 +1398,13 @@
 
     if (!cs)
     {
-	printf("Win32 Warning: Deleting uninitialized Critical Section %p!!\n", c);
+	dbgprintf("Win32 Warning: Deleting uninitialized Critical Section %p!!\n", c);
 	return;
     }
     
     if (cs->locked)
     {
-	printf("Win32 Warning: Deleting unlocked Critical Section %p!!\n", c);
+	dbgprintf("Win32 Warning: Deleting unlocked Critical Section %p!!\n", c);
 	pthread_mutex_unlock(&(cs->mutex));
     }
 
@@ -1837,15 +1837,6 @@
     if(data && count)dbgprintf("  read %d bytes: '%s'\n", *count, data);
     return result;
 }
-
-//from wine source dlls/advapi32/registry.c
-static long WINAPI expRegCreateKeyA(long hkey, const char* name, int *retkey)
-{
-    dbgprintf("RegCreateKeyA(key 0x%x, name 0x%x='%s',newkey=0x%x)\n",hkey,name,retkey);
-    return RegCreateKeyExA( hkey, name, 0, NULL,REG_OPTION_NON_VOLATILE,
-                            KEY_ALL_ACCESS , NULL, retkey, NULL );
-}
-
 static long WINAPI expRegCreateKeyExA(long key, const char* name, long reserved,
 				      void* classs, long options, long security,
 				      void* sec_attr, int* newkey, int* status)
@@ -4923,7 +4914,6 @@
 };
 struct exports exp_advapi32[]={
     FF(RegCloseKey, -1)
-    FF(RegCreateKeyA, -1)
     FF(RegCreateKeyExA, -1)
     FF(RegEnumKeyExA, -1)
     FF(RegEnumValueA, -1)
@@ -5159,7 +5149,7 @@
 
 #ifndef LOADLIB_TRY_NATIVE
   /* hack for truespeech and vssh264*/
-  if (!strcmp(library, "tsd32.dll") || !strcmp(library,"vssh264dec.dll") || !strcmp(library,"LCMW2.dll"))
+  if (!strcmp(library, "tsd32.dll") || !strcmp(library,"vssh264dec.dll"))
 #endif
     /* ok, this is a hack, and a big memory leak. should be fixed. - alex */
     {




More information about the MPlayer-dev-eng mailing list