[MPlayer-dev-eng] [PATCH] verbosity reduction in streaming, input, CPU detection

Diego Biurrun diego at biurrun.de
Sun Sep 24 18:22:39 CEST 2006


Hi,

these are a couple of verbosity reduction patches I have accumulated in
my local tree.  I'd like to commit by the end of the week, comments
welcome.

Diego
-------------- next part --------------
Index: stream/http.c
===================================================================
--- stream/http.c	(revision 19966)
+++ stream/http.c	(working copy)
@@ -891,7 +891,7 @@
 	stream->streaming_ctrl->url = check4proxies(url);
 	url_free(url);
 	
-	mp_msg(MSGT_OPEN, MSGL_INFO, "STREAM_HTTP(1), URL: %s\n", stream->url);
+	mp_msg(MSGT_OPEN, MSGL_V, "STREAM_HTTP(1), URL: %s\n", stream->url);
 	seekable = http_streaming_start(stream, file_format);
 	if((seekable < 0) || (*file_format == DEMUXER_TYPE_ASF)) {
 		streaming_ctrl_free(stream->streaming_ctrl);
@@ -915,7 +915,7 @@
 	stream->streaming_ctrl->url = check4proxies(url);
 	url_free(url);
 	
-	mp_msg(MSGT_OPEN, MSGL_INFO, "STREAM_HTTP(2), URL: %s\n", stream->url);
+	mp_msg(MSGT_OPEN, MSGL_V, "STREAM_HTTP(2), URL: %s\n", stream->url);
 	seekable = http_streaming_start(stream, file_format);
 	if(seekable < 0) {
 		streaming_ctrl_free(stream->streaming_ctrl);
Index: stream/network.c
===================================================================
--- stream/network.c	(revision 19966)
+++ stream/network.c	(working copy)
@@ -440,7 +440,7 @@
       stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5;
       if( stream_cache_size<64 ) stream_cache_size = 64;	// 16KBytes min buffer
     }
-    mp_msg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_CacheSizeSetTo, stream_cache_size);
+    mp_msg(MSGT_NETWORK,MSGL_V,"Cache size set to %d kBytes.\n", stream_cache_size);
   }
 }
 
Index: stream/stream_rtsp.c
===================================================================
--- stream/stream_rtsp.c	(revision 19966)
+++ stream/stream_rtsp.c	(working copy)
@@ -140,7 +140,7 @@
   URL_t *url;
   extern int index_mode;
   
-  mp_msg (MSGT_OPEN, MSGL_INFO, "STREAM_RTSP, URL: %s\n", stream->url);
+  mp_msg (MSGT_OPEN, MSGL_V, "STREAM_RTSP, URL: %s\n", stream->url);
   stream->streaming_ctrl = streaming_ctrl_new ();
   if (!stream->streaming_ctrl)
     return STREAM_ERROR;
Index: stream/tcp.c
===================================================================
--- stream/tcp.c	(revision 19966)
+++ stream/tcp.c	(working copy)
@@ -109,7 +109,7 @@
 	if ( inet_addr(host)==INADDR_NONE )
 #endif
 	{
-		if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ResolvingHostForAF, host, af2String(af));
+		if(verb) mp_msg(MSGT_NETWORK,MSGL_V,"Resolving %s for %s...\n", host, af2String(af));
 		
 #ifdef HAVE_GETHOSTBYNAME2
 		hp=(struct hostent*)gethostbyname2( host, af );
@@ -153,7 +153,7 @@
 #else
 	inet_ntop(af, our_s_addr, buf, 255);
 #endif
-	if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ConnectingToServer, host, buf , port );
+	if(verb) mp_msg(MSGT_NETWORK,MSGL_V,"Connecting to server %s[%s]: %d...\n", host, buf , port );
 
 	// Turn the socket as non blocking so we can timeout on the connection
 #ifndef HAVE_WINSOCK2
Index: input/joystick.c
===================================================================
--- input/joystick.c	(revision 19966)
+++ input/joystick.c	(working copy)
@@ -36,7 +36,7 @@
   int inited = 0;
   struct js_event ev;
   
-  mp_msg(MSGT_INPUT,MSGL_INFO,MSGTR_INPUT_JOYSTICK_Opening,dev ? dev : JS_DEV);
+  mp_msg(MSGT_INPUT,MSGL_V,MSGTR_INPUT_JOYSTICK_Opening,dev ? dev : JS_DEV);
 
   fd = open( dev ? dev : JS_DEV , O_RDONLY | O_NONBLOCK );
   if(fd < 0) {
Index: input/lirc.c
===================================================================
--- input/lirc.c	(revision 19966)
+++ input/lirc.c	(working copy)
@@ -23,9 +23,9 @@
 mp_input_lirc_init(void) {
   int lirc_sock;
 
-  mp_msg(MSGT_LIRC,MSGL_INFO,MSGTR_SettingUpLIRC);
+  mp_msg(MSGT_LIRC,MSGL_V,MSGTR_SettingUpLIRC);
   if((lirc_sock=lirc_init("mplayer",1))==-1){
-    mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCopenfailed MSGTR_LIRCdisabled);
+    mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCopenfailed);
     return -1;
   }
 
Index: cpudetect.c
===================================================================
--- cpudetect.c	(revision 19966)
+++ cpudetect.c	(working copy)
@@ -149,9 +149,9 @@
 		ptmpstr=tmpstr=GetCpuFriendlyName(regs, regs2);
 		while(*ptmpstr == ' ')        // strip leading spaces
 		    ptmpstr++;
-		mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: %s ", ptmpstr);
+		mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: %s ", ptmpstr);
 		free(tmpstr);
-		mp_msg(MSGT_CPUDETECT,MSGL_INFO,"(Family: %d, Model: %d, Stepping: %d)\n",
+		mp_msg(MSGT_CPUDETECT,MSGL_V,"(Family: %d, Model: %d, Stepping: %d)\n",
 		    caps->cpuType, caps->cpuModel, caps->cpuStepping);
 
 	}
@@ -570,47 +570,47 @@
         }
 #endif //__AMIGAOS4__
 #endif /* SYS_DARWIN */
-        mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
+        mp_msg(MSGT_CPUDETECT,MSGL_V,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
 #endif /* HAVE_ALTIVEC */
 
 #ifdef ARCH_IA64
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Intel Itanium\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Intel Itanium\n");
 #endif
 
 #ifdef ARCH_SPARC
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Sun Sparc\n");
 #endif
 
 #ifdef ARCH_ARMV4L
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: ARM\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: ARM\n");
 #endif
 
 #ifdef ARCH_POWERPC
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: PowerPC\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: PowerPC\n");
 #endif
 
 #ifdef ARCH_ALPHA
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Digital Alpha\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Digital Alpha\n");
 #endif
 
 #ifdef ARCH_SGI_MIPS
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: SGI MIPS\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: SGI MIPS\n");
 #endif
 
 #ifdef ARCH_PA_RISC
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Hewlett-Packard PA-RISC\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Hewlett-Packard PA-RISC\n");
 #endif
 
 #ifdef ARCH_S390
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390\n");
 #endif
 
 #ifdef ARCH_S390X
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390X\n");
+	mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390X\n");
 #endif
 
 #ifdef ARCH_VAX
-	mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Digital VAX\n" );
+	mp_msg(MSGT_CPUDETECT,MSGL_V, "CPU: Digital VAX\n" );
 #endif
 }
 #endif /* !ARCH_X86 */
Index: help/help_mp-en.h
===================================================================
--- help/help_mp-en.h	(revision 19966)
+++ help/help_mp-en.h	(working copy)
@@ -648,8 +648,7 @@
 
 // LIRC:
 #define MSGTR_SettingUpLIRC "Setting up LIRC support...\n"
-#define MSGTR_LIRCdisabled "You will not be able to use your remote control.\n"
-#define MSGTR_LIRCopenfailed "Failed to open LIRC support.\n"
+#define MSGTR_LIRCopenfailed "Failed to open LIRC support. You will not be able to use your remote control.\n"
 #define MSGTR_LIRCcfgerr "Failed to read LIRC config file %s.\n"
 
 // vf.c
@@ -1414,7 +1413,6 @@
 // network.c
 
 #define MSGTR_MPDEMUX_NW_UnknownAF "Unknown address family %d\n"
-#define MSGTR_MPDEMUX_NW_ResolvingHostForAF "Resolving %s for %s...\n"
 #define MSGTR_MPDEMUX_NW_CantResolv "Couldn't resolve name for %s: %s\n"
 #define MSGTR_MPDEMUX_NW_ConnectingToServer "Connecting to server %s[%s]: %d...\n"
 #define MSGTR_MPDEMUX_NW_CantConnect2Server "Failed to connect to server with %s\n"
@@ -1434,7 +1432,6 @@
 #define MSGTR_MPDEMUX_NW_AuthRequired "Authentication required.\n"
 #define MSGTR_MPDEMUX_NW_NoPasswdProvidedTryingBlank "No password provided, trying blank password.\n"
 #define MSGTR_MPDEMUX_NW_ErrServerReturned "Server returns %d: %s\n"
-#define MSGTR_MPDEMUX_NW_CacheSizeSetTo "Cache size set to %d KBytes\n"
 
 // demux_audio.c
 


More information about the MPlayer-dev-eng mailing list