[MPlayer-cvslog] CVS: main/libvo vesa_lvo.c, 1.19, 1.20 vo_png.c, 1.27, 1.28 vo_sdl.c, 1.124, 1.125 vo_svga.c, 1.81, 1.82 vo_vesa.c, 1.109, 1.110 vo_xvmc.c, 1.25, 1.26 vosub_vidix.c, 1.65, 1.66

Diego Biurrun CVS syncmail at mplayerhq.hu
Fri Mar 24 09:12:06 CET 2006


CVS change done by Diego Biurrun CVS

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

Modified Files:
	vesa_lvo.c vo_png.c vo_sdl.c vo_svga.c vo_vesa.c vo_xvmc.c 
	vosub_vidix.c 
Log Message:
Convert all if(verbose>X) to mp_msg_test calls.


Index: vesa_lvo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vesa_lvo.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- vesa_lvo.c	18 Apr 2005 15:52:38 -0000	1.19
+++ vesa_lvo.c	24 Mar 2006 08:12:02 -0000	1.20
@@ -20,6 +20,7 @@
 #include <string.h>
 
 #include "config.h"
+#include "mp_msg.h"
 
 #include "vesa_lvo.h"
 #include "img_format.h"
@@ -40,7 +41,6 @@
 static uint8_t next_frame;
 static mga_vid_config_t mga_vid_config;
 static unsigned image_bpp,image_height,image_width,src_format;
-extern int verbose;
 uint32_t vlvo_control(uint32_t request, void *data, ...);
 
 #define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8)
@@ -54,7 +54,8 @@
   printf("vesa_lvo: This branch is no longer supported.\n"
 	 "vesa_lvo: Please use -vo vesa:vidix instead\n");
   return -1;
-  if(verbose > 1) printf("vesa_lvo: vlvo_preinit(%s) was called\n",drvname);
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: vlvo_preinit(%s) was called\n",drvname); }
 	lvo_handler = open(drvname,O_RDWR);
 	if(lvo_handler == -1)
 	{
@@ -78,7 +79,8 @@
   printf("vesa_lvo: This branch is no longer supported.\n"
 	 "vesa_lvo: Please use -vo vesa:vidix instead\n");
   return -1;
-  if(verbose > 1) printf("vesa_lvo: vlvo_init() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: vlvo_init() was called\n"); }
 	image_width = src_width;
 	image_height = src_height;
 	mga_vid_config.version=MGA_VID_VERSION;
@@ -146,7 +148,8 @@
 
 void vlvo_term( void )
 {
-  if(verbose > 1) printf("vesa_lvo: vlvo_term() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: vlvo_term() was called\n"); }
 	ioctl( lvo_handler,MGA_VID_OFF,0 );
 	munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames);
 	if(lvo_handler != -1) close(lvo_handler);
@@ -194,7 +197,8 @@
 
 uint32_t vlvo_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
 {
- if(verbose > 1) printf("vesa_lvo: vlvo_draw_slice() was called\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+   printf("vesa_lvo: vlvo_draw_slice() was called\n"); }
     if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV)
 	vlvo_draw_slice_420(image,stride,w,h,x,y);
     else
@@ -213,13 +217,15 @@
 {
 /* Note it's very strange but sometime for YUY2 draw_frame is called */
   memcpy(lvo_mem,image[0],mga_vid_config.frame_size);
-  if(verbose > 1) printf("vesa_lvo: vlvo_draw_frame() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: vlvo_draw_frame() was called\n"); }
   return 0;
 }
 
 void     vlvo_flip_page(void)
 {
-  if(verbose > 1) printf("vesa_lvo: vlvo_flip_page() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: vlvo_flip_page() was called\n"); }
   if(vo_doublebuffering)
   {
 	ioctl(lvo_handler,MGA_VID_FSEL,&next_frame);
@@ -277,7 +283,8 @@
 
 void     vlvo_draw_osd(void)
 {
-  if(verbose > 1) printf("vesa_lvo: vlvo_draw_osd() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: vlvo_draw_osd() was called\n"); }
   /* TODO: hw support */
 #if 0
 /* disable this stuff until new fbvid.h interface will be implemented
@@ -289,7 +296,8 @@
 
 uint32_t vlvo_query_info(uint32_t format)
 {
-  if(verbose > 1) printf("vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format));
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vesa_lvo: query_format was called: %x (%s)\n",format,vo_format_name(format)); }
   return VFCAP_CSP_SUPPORTED;
 }
 

Index: vo_png.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_png.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- vo_png.c	5 Aug 2005 01:24:36 -0000	1.27
+++ vo_png.c	24 Mar 2006 08:12:02 -0000	1.28
@@ -14,6 +14,7 @@
 
 #include <png.h>
 
+#include "mp_msg.h"
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
@@ -29,7 +30,6 @@
 
 LIBVO_EXTERN (png)
 
-extern int verbose;
 int z_compression = Z_NO_COMPRESSION;
 static int framenum = 0;
 
@@ -50,7 +50,8 @@
 		    printf("PNG Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)\n");
 	    }	    
     
-    if(verbose)	printf("PNG Compression level %i\n", z_compression);   
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Compression level %i\n", z_compression); }
 	  	
     return 0;
 }
@@ -70,13 +71,15 @@
     png.info_ptr = png_create_info_struct(png.png_ptr);
    
     if (!png.png_ptr) {
-       if(verbose > 1) printf("PNG Failed to init png pointer\n");
+       if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+           printf("PNG Failed to init png pointer\n"); }
        png.status = ERROR;
        return png;
     }   
     
     if (!png.info_ptr) {
-       if(verbose > 1) printf("PNG Failed to init png infopointer\n");
+       if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+           printf("PNG Failed to init png infopointer\n"); }
        png_destroy_write_struct(&png.png_ptr,
          (png_infopp)NULL);
        png.status = ERROR;
@@ -84,7 +87,8 @@
     }
     
     if (setjmp(png.png_ptr->jmpbuf)) {
-	if(verbose > 1) printf("PNG Internal error!\n");    
+	if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+            printf("PNG Internal error!\n");}
         png_destroy_write_struct(&png.png_ptr, &png.info_ptr);
         fclose(png.fp);
         png.status = ERROR;
@@ -98,7 +102,8 @@
        	return png;
     }	    
     
-    if(verbose > 1) printf("PNG Init IO\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Init IO\n"); }
     png_init_io(png.png_ptr, png.fp);
 
     /* set the zlib compression level */
@@ -112,11 +117,13 @@
        8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
        PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
     
-    if(verbose > 1) printf("PNG Write Info\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Write Info\n"); }
     png_write_info(png.png_ptr, png.info_ptr);
     
     if(swapped) {
-    	if(verbose > 1) printf("PNG Set BGR Conversion\n");
+    	if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+            printf("PNG Set BGR Conversion\n"); }
     	png_set_bgr(png.png_ptr);
     }	
 
@@ -126,10 +133,12 @@
        
 static uint8_t destroy_png(struct pngdata png) {
 	    
-    if(verbose > 1) printf("PNG Write End\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Write End\n"); }
     png_write_end(png.png_ptr, png.info_ptr);
 
-    if(verbose > 1) printf("PNG Destroy Write Struct\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Destroy Write Struct\n"); }
     png_destroy_write_struct(&png.png_ptr, &png.info_ptr);
     
     fclose (png.fp);
@@ -155,14 +164,16 @@
 	    return 1;
     }	     
 
-    if(verbose > 1) printf("PNG Creating Row Pointers\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Creating Row Pointers\n"); }
     for ( k = 0; k < mpi->h; k++ )
 	row_pointers[k] = mpi->planes[0]+mpi->stride[0]*k;
 
     //png_write_flush(png.png_ptr);
     //png_set_flush(png.png_ptr, nrows);
 
-    if(verbose > 1) printf("PNG Writing Image Data\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("PNG Writing Image Data\n"); }
     png_write_image(png.png_ptr, row_pointers);
 
     destroy_png(png);

Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- vo_sdl.c	26 Dec 2005 03:16:47 -0000	1.124
+++ vo_sdl.c	24 Mar 2006 08:12:02 -0000	1.125
@@ -105,6 +105,7 @@
 #include <string.h>
 #include <inttypes.h>
 
+#include "mp_msg.h"
 #include "config.h"
 #include "video_out.h"
 #include "video_out_internal.h"
@@ -123,8 +124,6 @@
 #include "input/mouse.h"
 #include "subopt-helper.h"
 
-extern int verbose;
-
 static vo_info_t info = 
 {
 	"SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)",
@@ -141,14 +140,16 @@
 
 #ifdef SDL_ENABLE_LOCKS
 #define	SDL_OVR_LOCK(x)        if (SDL_LockYUVOverlay (priv->overlay)) { \
-				if(verbose) printf("SDL: Couldn't lock YUV overlay\n"); \
+				if( mp_msg_test(MSGT_VO,MSGL_V) ) { \
+				  printf("SDL: Couldn't lock YUV overlay\n");} \
 				return x; \
 	    		    }
 #define SDL_OVR_UNLOCK      SDL_UnlockYUVOverlay (priv->overlay);
 
 #define SDL_SRF_LOCK(srf, x)   if(SDL_MUSTLOCK(srf)) { \
 				if(SDL_LockSurface (srf)) { \
-					if(verbose) printf("SDL: Couldn't lock RGB surface\n"); \
+					if( mp_msg_test(MSGT_VO,MSGL_V) ) { \
+					  printf("SDL: Couldn't lock RGB surface\n"); } \
 					return x; \
 				} \
 			    }
@@ -422,18 +423,21 @@
 
 	/* other default values */
 	#ifdef SDL_NOHWSURFACE
-		if(verbose) printf("SDL: using software-surface\n");
+		if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: using software-surface\n"); }
 		priv->sdlflags = SDL_SWSURFACE|SDL_RESIZABLE|SDL_ANYFORMAT;
 		priv->sdlfullflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_ANYFORMAT;
 		// XXX:FIXME: ASYNCBLIT should be enabled for SMP systems
 	#else	
 		/*if((strcmp(priv->driver, "dga") == 0) && (priv->mode)) {
-			if(verbose) printf("SDL: using software-surface\n");
+			if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+				printf("SDL: using software-surface\n"); }
 			priv->sdlflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_ASYNCBLIT|SDL_HWACCEL|SDL_ANYFORMAT;
 			priv->sdlfullflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_ASYNCBLIT|SDL_HWACCEL|SDL_ANYFORMAT;
 		}	
 		else {	*/
-			if(verbose) printf("SDL: using hardware-surface\n");
+			if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+				printf("SDL: using hardware-surface\n"); }
 			priv->sdlflags = SDL_HWSURFACE|SDL_RESIZABLE/*|SDL_ANYFORMAT*/;
 			priv->sdlfullflags = SDL_HWSURFACE|SDL_FULLSCREEN/*|SDL_ANYFORMAT*/;
 			// XXX:FIXME: ASYNCBLIT should be enabled for SMP systems
@@ -483,7 +487,8 @@
 	priv->bpp = vidInfo->vfmt->BitsPerPixel;
 	if (priv->mode == YUV && priv->bpp < 16) {
 
-		if(verbose) printf("SDL: Your SDL display target wants to be at a color "
+		if( mp_msg_test(MSGT_VO,MSGL_V) )
+                    printf("SDL: Your SDL display target wants to be at a color "
                            "depth of (%d), but we need it to be at least 16 "
                            "bits, so we need to emulate 16-bit color. This is "
                            "going to slow things down; you might want to "
@@ -561,7 +566,8 @@
 #if 0
 static SDL_Rect aspect(int srcw, int srch, int dstw, int dsth) {
 	SDL_Rect newres;
-	if(verbose > 1) printf("SDL Aspect: src: %ix%i dst: %ix%i\n", srcw, srch, dstw, dsth);
+	if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+		printf("SDL Aspect: src: %ix%i dst: %ix%i\n", srcw, srch, dstw, dsth); }
 	newres.h = ((float)dstw / (float)srcw * (float)srch) * ((float)dsth/((float)dstw/(MONITOR_ASPECT)));
 	if(newres.h > dsth) {
 		newres.w = ((float)dsth / (float)newres.h) * dstw;
@@ -575,7 +581,8 @@
 		newres.y = (dsth - newres.h) / 2;
 	}
 	
-	if(verbose) printf("SDL Aspect-Destinationres: %ix%i (x: %i, y: %i)\n", newres.w, newres.h, newres.x, newres.y);
+	if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+		printf("SDL Aspect-Destinationres: %ix%i (x: %i, y: %i)\n", newres.w, newres.h, newres.x, newres.y); }
 
 	return newres;
 }
@@ -676,7 +683,7 @@
 	else if (mode < 0) {
         int i,j,imax;
 		mode = 0; // Default to the biggest mode avaible
-		if (verbose) for(i=0;priv->fullmodes[i];++i) 
+		if ( mp_msg_test(MSGT_VO,MSGL_V) ) for(i=0;priv->fullmodes[i];++i)
 	           printf("SDL Mode: %d:  %d x %d\n", i, priv->fullmodes[i]->w, priv->fullmodes[i]->h);
 		for(i = findArrayEnd(priv->fullmodes) - 1; i >=0; i--) {
 		  if( (priv->fullmodes[i]->w >= priv->dstwidth) && 
@@ -691,7 +698,8 @@
 		      break;
 		    }
 		  }
-		if (verbose) printf("SET SDL Mode: %d:  %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h);
+		if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SET SDL Mode: %d:  %d x %d\n", mode, priv->fullmodes[mode]->w, priv->fullmodes[mode]->h); }
 		priv->fullmode = mode;
         screen_surface_h = priv->fullmodes[mode]->h;
         screen_surface_w = priv->fullmodes[mode]->w;
@@ -800,8 +808,8 @@
 
     if ( vo_config_count ) sdl_close();
 
-    if(verbose) printf("SDL: Using 0x%X (%s) image format\n", format,
-                       vo_format_name(format));
+    if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+      printf("SDL: Using 0x%X (%s) image format\n", format, vo_format_name(format)); }
     
     if(priv->mode != YUV) {
 		priv->sdlflags |= SDL_ANYFORMAT;
@@ -848,11 +856,13 @@
 //      printf("SDL: flags are set to: %i\n", flags);
 //	printf("SDL: Width: %i Height: %i D_Width %i D_Height: %i\n", width, height, d_width, d_height);
 	if(flags&VOFLAG_FLIPPING) {
-		if(verbose) printf("SDL: using flipped video (only with RGB/BGR/packed YUV)\n");
+		if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: using flipped video (only with RGB/BGR/packed YUV)\n"); }
 		priv->flip = 1; 
 	}
 	if(flags&VOFLAG_FULLSCREEN) {
-	  	if(verbose) printf("SDL: setting zoomed fullscreen without modeswitching\n");
+	  	if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: setting zoomed fullscreen without modeswitching\n"); }
 		printf("SDL: Info - please use -vm or -zoom to switch to best resolution.\n");
 		priv->fulltype = VOFLAG_FULLSCREEN;
 		set_fullmode(priv->fullmode);
@@ -860,14 +870,16 @@
 			SDL_ShowCursor(0);*/
 	} else	
 	if(flags&VOFLAG_MODESWITCHING) {
-	 	if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n");
+	 	if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: setting zoomed fullscreen with modeswitching\n"); }
 		priv->fulltype = VOFLAG_MODESWITCHING;
 		set_fullmode(priv->fullmode);
           	/*if((priv->surface = SDL_SetVideoMode (d_width ? d_width : width, d_height ? d_height : height, priv->bpp, priv->sdlfullflags)))
 			SDL_ShowCursor(0);*/
 	} else
 	if(flags&VOFLAG_SWSCALE) {
-	 	if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n");
+	 	if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: setting zoomed fullscreen with modeswitching\n"); }
 		priv->fulltype = VOFLAG_SWSCALE;
 		set_fullmode(priv->fullmode);
 	} 
@@ -878,11 +890,13 @@
 		||(strcmp(priv->driver, "Quartz") == 0)
 		||(strcmp(priv->driver, "cgx") == 0)
 		||((strcmp(priv->driver, "aalib") == 0) && priv->X)){
-			if(verbose) printf("SDL: setting windowed mode\n");
+			if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+				printf("SDL: setting windowed mode\n"); }
             set_video_mode(priv->dstwidth, priv->dstheight, priv->bpp, priv->sdlflags);
 		}
 		else {
-			if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n");
+			if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+				printf("SDL: setting zoomed fullscreen with modeswitching\n"); }
 			priv->fulltype = VOFLAG_SWSCALE;
 			set_fullmode(priv->fullmode);
 		}	
@@ -1167,7 +1181,8 @@
 				    priv->windowsize.w = priv->surface->w;
 				    priv->windowsize.h = priv->surface->h;
 				//}
-				if(verbose > 2) printf("SDL: Window resize\n");
+				if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+					printf("SDL: Window resize\n"); }
 			break;
 			
 			case SDL_MOUSEBUTTONDOWN:
@@ -1207,7 +1222,8 @@
 			case SDL_KEYDOWN:
 #endif			
 				keypressed = event.key.keysym.sym;
-				if(verbose > 1) printf("SDL: Key pressed: '%i'\n", keypressed);
+				if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+					printf("SDL: Key pressed: '%i'\n", keypressed); }
 
 				/* c key pressed. c cycles through available fullscreenmodes, if we have some */
 				if ( ((keypressed == SDLK_c)) && (priv->fullmodes) ) {
@@ -1216,7 +1232,8 @@
 					if (priv->fullmode > (findArrayEnd(priv->fullmodes) - 1)) priv->fullmode = 0;
 					set_fullmode(priv->fullmode);
 	
-					if(verbose > 1) printf("SDL: Set next available fullscreen mode.\n");
+					if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+						printf("SDL: Set next available fullscreen mode.\n"); }
 				}
 
 				else if ( keypressed == SDLK_n ) {
@@ -1227,13 +1244,15 @@
                         set_video_mode(priv->dstwidth, priv->dstheight, priv->bpp, priv->sdlflags);
 					    	priv->windowsize.w = priv->surface->w;
 						priv->windowsize.h = priv->surface->h;
-						if(verbose > 1) printf("SDL: Normal size\n");
+						if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+							printf("SDL: Normal size\n"); }
 					} else
 					if (priv->surface->w != priv->dstwidth * 2 || priv->surface->h != priv->dstheight * 2) {
                         set_video_mode(priv->dstwidth * 2, priv->dstheight * 2, priv->bpp, priv->sdlflags);
 					    	priv->windowsize.w = priv->surface->w;
 						priv->windowsize.h = priv->surface->h;
-						if(verbose > 1) printf("SDL: Double size\n");
+						if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+							printf("SDL: Double size\n"); }
 					}
 				}	
 
@@ -1555,7 +1574,8 @@
 #ifdef HAVE_X11
     struct sdl_priv_s *priv = &sdl_priv;
     if(priv->X) {
-		if(verbose) printf("SDL: activating XScreensaver/DPMS\n");
+		if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: activating XScreensaver/DPMS\n"); }
 		vo_x11_uninit();
 	}
 #endif
@@ -1565,7 +1585,8 @@
     if(SDL_WasInit(SDL_INIT_VIDEO))
         SDL_QuitSubSystem(SDL_INIT_VIDEO);
 
-	if(verbose > 2) printf("SDL: Closed Plugin\n");
+	if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+		printf("SDL: Closed Plugin\n"); }
 
 }
 
@@ -1591,7 +1612,8 @@
     priv->overlay = NULL;
     priv->surface = NULL;
 
-    if(verbose > 2) printf("SDL: Opening Plugin\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+        printf("SDL: Opening Plugin\n"); }
 
     if(sdl_driver) {
         setenv("SDL_VIDEODRIVER", sdl_driver, 1);
@@ -1626,11 +1648,13 @@
     priv->X = 0;
 #ifdef HAVE_X11
     if(vo_init()) {
-		if(verbose) printf("SDL: deactivating XScreensaver/DPMS\n");
+		if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: deactivating XScreensaver/DPMS\n"); }
 		priv->XWidth = vo_screenwidth;
 		priv->XHeight = vo_screenheight;
 		priv->X = 1;
-		if(verbose) printf("SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight);
+		if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight); }
 	}
 #endif
 
@@ -1695,10 +1719,12 @@
     if (priv->surface->flags & SDL_FULLSCREEN) {
       set_video_mode(priv->windowsize.w, priv->windowsize.h, priv->bpp, priv->sdlflags);
       SDL_ShowCursor(1);
-      if(verbose > 1) printf("SDL: Windowed mode\n");
+      if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("SDL: Windowed mode\n"); }
     } else if (priv->fullmodes) {
       set_fullmode(priv->fullmode);
-      if(verbose > 1) printf("SDL: Set fullscreen mode\n");
+      if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+        printf("SDL: Set fullscreen mode\n"); }
     }
     return VO_TRUE;
   }

Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- vo_svga.c	21 Aug 2005 01:20:31 -0000	1.81
+++ vo_svga.c	24 Mar 2006 08:12:02 -0000	1.82
@@ -52,7 +52,6 @@
 //silence warnings, probably it have to go in some global header
 #define UNUSED(x) ((void)(x)) 
 
-extern int verbose;
 
 static int query_format(uint32_t format);
 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
@@ -172,7 +171,7 @@
 
         force_vm=vga_getmodenumber(s);
         if(force_vm>0) {
-          if(verbose) printf("vo_svga: Forcing mode %i\n",force_vm);
+          if( mp_msg_test(MSGT_VO,MSGL_V) ) printf("vo_svga: Forcing mode %i\n",force_vm);
         }else{ 
           force_vm = 0;
         }
@@ -191,7 +190,7 @@
 int i;
 
   if (mode_capabilities&CAP_ACCEL_CLEAR){
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
       printf("vo_svga: clearing box %d,%d - %d,%d with HW acceleration\n",
              x,y,w,h);
     if(mode_capabilities&CAP_ACCEL_BACKGR)  
@@ -201,7 +200,7 @@
     return;
   }
   if (mode_capabilities & CAP_LINEAR){
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
       printf("vo_svga: clearing box %d,%d - %d,%d with memset\n",x,y,w,h);
     rgbplane=PageStore[0].vbase + (y*mode_stride) + (x*modeinfo->bytesperpixel);
     for(i=0;i<h;i++){
@@ -213,7 +212,7 @@
     return;
   }
   //native
-  if(verbose > 2)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
     printf("vo_svga: clearing box %d,%d - %d,%d with native draw \n",x,y,w,h);
   if(modeinfo->bytesperpixel!=0) w*=modeinfo->bytesperpixel;
   for(i=0;i<h;i++){
@@ -229,7 +228,7 @@
 int page;
 
   if(mpi->flags & MP_IMGFLAG_DIRECT){
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
       printf("vo_svga: drawing direct rendered surface\n");
     cpage=(uint32_t)mpi->priv;
     assert((cpage>=0)&&(cpage<max_pages));
@@ -259,7 +258,7 @@
         (stride == mode_stride) ){ //only monolite image can be accelerated
       w=(stride*8)/mpi->bpp;//we transfer pixels in the stride so the source
 //ACCELERATE
-      if(verbose>2) 
+      if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_svga: using HW PutImage (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
       if(mode_capabilities & CAP_ACCEL_BACKGR)
         vga_accel(ACCEL_SYNC);
@@ -270,7 +269,7 @@
   
     if( mode_capabilities&CAP_LINEAR){
 //DIRECT  
-      if(verbose>2) 
+      if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_svga: using Direct memcpy (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
       bytesperline=(w*mpi->bpp)/8;
       base=PageStore[cpage].vbase + (y*mode_stride) + (x*mpi->bpp)/8;     
@@ -292,7 +291,7 @@
   //one byte per pixel! svgalib innovation
     if(mpi->imgfmt==IMGFMT_RG4B || mpi->imgfmt==IMGFMT_BG4B) length=w;
   
-    if(verbose>2) 
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
       printf("vo_svga: using Native vga_draw(x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
     y+=PageStore[cpage].yoffset;//y position of the page beggining
     for(i=0;i<h;i++){
@@ -328,7 +327,7 @@
   for(i=1;i<=lastmode;i++){
     vminfo = vga_getmodeinfo(i);
     if( vminfo == NULL ) continue;
-    if(verbose>3)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_svga: testing mode %d (%s)\n",i,vga_getmodename(i));
     if( vga_hasmode(i) == 0 ) continue;
     if( req_bpp != bpp_from_vminfo(vminfo) )continue;
@@ -341,7 +340,7 @@
     if( bestmode==0 || prev_badness >= badness ){//modeX etc...
       prev_badness=badness;
       bestmode=i;
-      if(verbose>3)
+      if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
         printf("vo_svga: found good mode %d with badness %d\n",i,badness);
     }
   }
@@ -404,7 +403,7 @@
   int32_t req_bpp;
   
   uint32_t accflags;
-  if(verbose)
+  if( mp_msg_test(MSGT_VO,MSGL_V) )
     printf("vo_svga: config(%i, %i, %i, %i, %08x, %s, %08x)\n", width, height,
            d_width, d_height, flags, title, format);
 //Only RGB modes supported
@@ -414,7 +413,7 @@
   if( vo_dbpp!=0 && vo_dbpp!=req_bpp) {assert(0);return-1;}
     
   if(!force_vm) {
-    if (verbose) {
+    if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
       printf("vo_svga: Looking for the best resolution...\n");
       printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,req_bpp);
     }
@@ -593,7 +592,7 @@
 
 static void draw_osd(void)
 {
-  if(verbose > 3)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
      printf("vo_svga: draw_osd()\n");
   //only modes with bytesperpixel>0 can draw OSD
   if(modeinfo->bytesperpixel==0) return;
@@ -622,10 +621,10 @@
   PageStore[old_page].locks=PAGE_EMPTY;
   PageStore[cpage].locks=PAGE_BUSY;
 
-  if(verbose > 2)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
     printf("vo_svga: viewing page %d\n",cpage);
   if(sync_flip && old_page!=cpage){
-    if(verbose > 2) printf("vo_svga:vga_waitretrace\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) printf("vo_svga:vga_waitretrace\n");
     vga_waitretrace();
   }
   vga_setdisplaystart(PageStore[cpage].doffset);
@@ -650,7 +649,7 @@
 int i,lastmode;
 vga_modeinfo * vminfo;
 
-  if (verbose >3)
+  if ( mp_msg_test(MSGT_VO,MSGL_DBG4) )
     printf("vo_svga: query_format=%X \n",format);
 //only RGB modes supported
   if( (!IMGFMT_IS_RGB(format)) && (!IMGFMT_IS_BGR(format)) ) return 0; 
@@ -688,7 +687,7 @@
                        unsigned char *srca, int stride) {
   char* base;
 
-  if(verbose>2)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
     printf("vo_svga: draw_alpha(x0=%d,y0=%d,w=%d,h=%d,src=%p,srca=%p,stride=%d\n",
            x0,y0,w,h,src,srca,stride);
   if(!blackbar_osd) {
@@ -697,7 +696,7 @@
     y0+=y_pos;
   }
   
-  if(verbose>3)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
     printf("vo_svga: OSD draw in page %d\n",cpage);
   base=PageStore[cpage].vbase + y0*mode_stride + x0*modeinfo->bytesperpixel;
   switch (mode_bpp) {
@@ -745,7 +744,7 @@
       mpi->planes[0] = PageStore[page].vbase + 
              y_pos*mode_stride + (x_pos*mpi->bpp)/8;
       mpi->priv=(void *)page;
-      if(verbose>2)
+      if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_svga: direct render allocated! page=%d\n",page);
       return(VO_TRUE);
     }

Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- vo_vesa.c	23 Oct 2005 16:19:32 -0000	1.109
+++ vo_vesa.c	24 Mar 2006 08:12:02 -0000	1.110
@@ -43,6 +43,7 @@
 #ifdef CONFIG_VIDIX
 #include "vosub_vidix.h"
 #endif
+#include "mp_msg.h"
 
 #include "postproc/swscale.h"
 #include "libmpcodecs/vf_scale.h"
@@ -52,8 +53,6 @@
 extern vo_functions_t video_out_png;
 #endif
 
-extern int verbose;
-
 extern char *monitor_hfreq_str;
 extern char *monitor_vfreq_str;
 extern char *monitor_dotclock_str;
@@ -280,7 +279,7 @@
     int dstride=HAS_DGA()?video_mode_info.XResolution:dstW;
     uint8_t *dst[3]= {dga_buffer, NULL, NULL};
     int dstStride[3];
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
 	printf("vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y);
     dstStride[0]=dstride*((dstBpp+7)/8);
     dstStride[1]=
@@ -361,7 +360,7 @@
 static void draw_osd(void)
 {
  uint32_t w,h;
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
 	printf("vo_vesa: draw_osd was called\n");
  {
 #ifdef OSD_OUTSIDE_MOVIE
@@ -377,7 +376,7 @@
 
 static void flip_page(void)
 {
-  if(verbose > 2)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
 	printf("vo_vesa: flip_page was called\n");
   if(flip_trigger) 
   {
@@ -412,7 +411,7 @@
 /* is called for rgb only */
 static int draw_frame(uint8_t *src[])
 {
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_vesa: draw_frame was called\n");
     if(sws)
     {
@@ -463,7 +462,7 @@
 
 static int query_format(uint32_t format)
 {
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
 #ifdef CONFIG_VIDIX
     if(vidix_name)return(vidix_query_fourcc(format));
@@ -538,7 +537,8 @@
   screen_size = video_mode_info.XResolution*video_mode_info.YResolution*((dstBpp+7)/8);
   if(screen_size%64) screen_size=((screen_size/64)*64)+64;
   total = vsize / screen_size;
-  if(verbose) printf("vo_vesa: Can use up to %u video buffers\n",total);
+  if( mp_msg_test(MSGT_VO,MSGL_V) )
+    printf("vo_vesa: Can use up to %u video buffers\n",total);
   i = 0;
   offset = 0;
   total = min(total,nbuffs);
@@ -715,7 +715,7 @@
 		   dstFourcc = IMGFMT_BGR16;
 		   break;
 	}
-	if(verbose)
+	if( mp_msg_test(MSGT_VO,MSGL_V) )
 	{
 	  printf("vo_vesa: Requested mode: %ux%u@%u (%s)\n",width,height,bpp,vo_format_name(format));
 	  printf("vo_vesa: Total modes found: %u\n",num_modes);
@@ -758,7 +758,7 @@
 				best_mode_idx = i;
 			   }
 		   }
-		if(verbose)
+		if( mp_msg_test(MSGT_VO,MSGL_V) )
 		{
 		  printf("vo_vesa: Mode (%03u): mode=%04X %ux%u@%u attr=%04X\n"
 			 "vo_vesa:             #planes=%u model=%u(%s) #pages=%u\n"
@@ -783,7 +783,8 @@
 			PRINT_VBE_ERR("vbeGetMode",err);
 			return -1;
 		}
-		if(verbose) printf("vo_vesa: Initial video mode: %x\n",init_mode);
+		if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("vo_vesa: Initial video mode: %x\n",init_mode); }
 		if((err=vbeGetModeInfo(video_mode,&video_mode_info)) != VBE_OK)
 		{
 			PRINT_VBE_ERR("vbeGetModeInfo",err);
@@ -828,7 +829,8 @@
 			printf("vo_vesa: Can't initialize SwScaler\n");
 			return -1;
 		    }
-		    else if(verbose) printf("vo_vesa: Using SW BES emulator\n");
+		    else if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("vo_vesa: Using SW BES emulator\n"); }
 		}
 		if((video_mode_info.WinAAttributes & FRAME_MODE) == FRAME_MODE)
 		   win.idx = 0; /* frame A */
@@ -855,7 +857,8 @@
 		      printf("vo_vesa: Using DGA (physical resources: %08lXh, %08lXh)"
 			     ,video_mode_info.PhysBasePtr
 			     ,vsize);
-		      if(verbose) printf(" at %08lXh",(unsigned long)lfb);
+		      if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf(" at %08lXh",(unsigned long)lfb); }
 		      printf("\n");
 		      if(!(multi_size = fillMultiBuffer(vsize,2))) return -1;
 		      if(vo_doublebuffering && multi_size < 2)
@@ -891,7 +894,7 @@
 		if(video_mode_info.YResolution > dstH)
 		    y_offset = (video_mode_info.YResolution - dstH) / 2;
 		else y_offset = 0;
-		if(verbose)
+		if( mp_msg_test(MSGT_VO,MSGL_V) )
 		  printf("vo_vesa: image: %ux%u screen = %ux%u x_offset = %u y_offset = %u\n"
 			,dstW,dstH
 			,video_mode_info.XResolution,video_mode_info.YResolution
@@ -915,7 +918,8 @@
 		      printf("vo_vesa: Can't allocate temporary buffer\n");
 		      return -1;
 		    }
-		    if(verbose) printf("vo_vesa: dga emulator was allocated = %p\n",dga_buffer);
+		    if( mp_msg_test(MSGT_VO,MSGL_V) ) {
+			printf("vo_vesa: dga emulator was allocated = %p\n",dga_buffer); }
 		  }
 		}
 		if((err=vbeSaveState(&init_state)) != VBE_OK)
@@ -956,7 +960,7 @@
 		}
 		/* Now we are in video mode!!!*/
 		/* Below 'return -1' is impossible */
-		if(verbose)
+		if( mp_msg_test(MSGT_VO,MSGL_V) )
 		{
 		  printf("vo_vesa: Graphics mode was activated\n");
 		  fflush(stdout);
@@ -1013,7 +1017,7 @@
 	  printf("vo_vesa: Can't find mode for: %ux%u@%u\n",width,height,bpp);
 	  return -1;
 	}
-	if(verbose)
+	if( mp_msg_test(MSGT_VO,MSGL_V) )
 	{
 	  printf("vo_vesa: VESA initialization complete\n");
 	  fflush(stdout);
@@ -1024,13 +1028,13 @@
 	    {
 		win.ptr = dga_buffer = video_base + multi_buff[i];
                 clear_screen();	/* Clear screen for stupid BIOSes */
-		if(verbose>1) paintBkGnd();
+		if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) paintBkGnd();
 	    }
 	}
 	else
 	{
             clear_screen();	/* Clear screen for stupid BIOSes */
-	    if(verbose>1)
+	    if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
 	    {
 	        int x;
 	        x = (video_mode_info.XResolution/video_mode_info.XCharSize)/2-strlen(title)/2;
@@ -1047,14 +1051,14 @@
 {
     // not inited
     vesa_term();
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_vesa: uninit was called\n");
 }
 
 
 static void check_events(void)
 {
-    if(verbose > 2)
+    if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_vesa: check_events was called\n");
 /* Nothing to do */
 }
@@ -1063,8 +1067,9 @@
 {
   int pre_init_err = 0;
   int fd;
-  if(verbose>1) printf("vo_vesa: preinit(%s) was called\n",arg);
-  if(verbose > 2)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
+        printf("vo_vesa: preinit(%s) was called\n",arg);
+  if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_vesa: subdevice %s is being initialized\n",arg);
   subdev_flags = 0;
   lvo_name = NULL;
@@ -1083,7 +1088,7 @@
   	return -1;
   else
   	close(fd);
-  if(verbose > 2)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
         printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
   return pre_init_err;
 }

Index: vo_xvmc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvmc.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- vo_xvmc.c	20 Dec 2005 19:04:17 -0000	1.25
+++ vo_xvmc.c	24 Mar 2006 08:12:02 -0000	1.26
@@ -46,8 +46,6 @@
 #define UNUSED(x) ((void)(x))
 
 
-extern int vo_verbose;
-
 static int benchmark;
 static int use_sleep;
 static int first_frame;//draw colorkey on first frame
@@ -270,21 +268,26 @@
 
    rez = XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay),&num_adaptors,&ai);
    if( rez != Success ) return -1;
-   if( verbose > 2 ) printf("vo_xvmc: Querying %d adaptors\n",num_adaptors);
+   if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+      printf("vo_xvmc: Querying %d adaptors\n",num_adaptors); }
    for(i=0; i<num_adaptors; i++)
    {
-      if( verbose > 2) printf("vo_xvmc: Quering adaptor #%d\n",i);
+      if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+         printf("vo_xvmc: Quering adaptor #%d\n",i); }
       if( ai[i].type == 0 ) continue;// we need at least dummy type!
 //probing ports
       for(p=ai[i].base_id; p<ai[i].base_id+ai[i].num_ports; p++)
       {
-         if( verbose > 2) printf("vo_xvmc: probing port #%ld\n",p);
+         if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+            printf("vo_xvmc: probing port #%ld\n",p); }
 	 mc_surf_list = XvMCListSurfaceTypes(mDisplay,p,&mc_surf_num);
 	 if( mc_surf_list == NULL || mc_surf_num == 0){
-	    if( verbose > 2) printf("vo_xvmc: No XvMC supported. \n");
+	    if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+               printf("vo_xvmc: No XvMC supported. \n"); }
 	    continue;
 	 }
-	 if( verbose > 2) printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num);
+	 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+            printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num); }
 //we have XvMC list!
          for(s=0; s<mc_surf_num; s++)
          {
@@ -301,7 +304,8 @@
             if(!query){
                rez = XvGrabPort(mDisplay,p,CurrentTime);
 	       if(rez != Success){
-	          if (verbose > 2) printf("vo_xvmc: Fail to grab port %ld\n",p);
+	          if ( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
+                     printf("vo_xvmc: Fail to grab port %ld\n",p); }
 	          continue;
 	       }
 	       printf("vo_xvmc: Port %ld grabed\n",p);
@@ -320,7 +324,7 @@
 surface_found:
 
    memcpy(surf_info,&mc_surf_list[s],sizeof(XvMCSurfaceInfo));
-   if( verbose > 2 || !query) 
+   if( mp_msg_test(MSGT_VO,MSGL_DBG3) || !query)
       printf("vo_xvmc: Found matching surface with id=%X on %ld port at %d adapter\n",
              mc_surf_list[s].surface_type_id,p,i);
    return mc_surf_list[s].surface_type_id;
@@ -336,7 +340,7 @@
    rndr = (xvmc_render_state_t*)mpi->priv;//there is copy in plane[2]
    assert( rndr != NULL );
    assert( rndr->magic == MP_XVMC_RENDER_MAGIC );
-   if( verbose > 3 ) 
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
        printf("vo_xvmc: draw_image(show rndr=%p)\n",rndr);
 // the surface have passed vf system without been skiped, it will be displayed
    rndr->state |= MP_XVMC_STATE_DISPLAY_PENDING;
@@ -500,7 +504,7 @@
       surface_render[i].chroma_format = surface_info.chroma_format;
       surface_render[i].unsigned_intra = (surface_info.flags & XVMC_INTRA_UNSIGNED) == XVMC_INTRA_UNSIGNED;
       surface_render[i].p_surface = &surface_array[i];
-      if( verbose > 3 )
+      if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
           printf("vo_xvmc: surface[%d] = %p .rndr=%p\n",i,&surface_array[i], &surface_render[i]);
    }
    number_of_surfaces = i;
@@ -532,7 +536,7 @@
                       surface_info.surface_type_id, &num_subpic);
 
       if(num_subpic != 0 && xvfmv != NULL){
-         if(verbose > 3){//Print All subpicture types for debug
+         if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){//Print all subpicture types for debug
             for(s=0;s<num_subpic;s++)
                print_xvimage_format_values(&xvfmv[s]);
          }
@@ -813,7 +817,7 @@
 int rez;
 
    if(subpicture_alloc){
-      if(verbose>3)
+      if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
          printf("vo_xvmc: destroying subpicture\n");
       XvMCDestroySubpicture(mDisplay,&subpicture);
       deallocate_xvimage();
@@ -836,7 +840,7 @@
    if(osd_width == 0 || osd_height == 0) 
       return;//if called before window size is known
 
-   if(verbose > 3)
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: creating subpicture (%d,%d) format %X\n",
               osd_width,osd_height,subpicture_info.id);
 
@@ -847,7 +851,7 @@
       printf("vo_xvmc: Create Subpicture failed, OSD disabled\n");
       return;
    }
-   if(verbose > 3){
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) ){
    int i;
       printf("vo_xvmc: Created Subpicture:\n");
       printf("         xvimage_id=0x%X\n",subpicture.xvimage_id);
@@ -865,7 +869,7 @@
    
    //call init for the surface type
    init_osd_fnc();//init palete,clear color etc ...
-   if(verbose > 3)
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: clearing subpicture\n");
    clear_osd_fnc(0, 0, subpicture.width, subpicture.height);
 
@@ -877,7 +881,7 @@
 int ox,oy;
 int rez;
 
-   if(verbose > 3)
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
 
    for(ox=0; ox<w; ox++){
@@ -896,7 +900,7 @@
 static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
 int ox,oy;
 int rez;
-   if( verbose > 3)
+   if(  mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0,y0,w,h);
 
    for(ox=0; ox<w; ox++){
@@ -918,7 +922,7 @@
 int have_osd_to_draw;
 int rez;
 
-   if(verbose > 3)
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: draw_osd ,OSD_mode=%d, surface_to_show=%p\n",
              subpicture_mode,p_render_surface_to_show);
 
@@ -973,7 +977,7 @@
          p_render_surface_to_show = osd_rndr;
          p_render_surface_to_show->state = MP_XVMC_STATE_DISPLAY_PENDING;
 
-         if(verbose > 3)
+         if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
             printf("vo_xvmc:draw_osd: surface_to_show changed to %p\n",osd_rndr);
       }//endof if(BLEND)
       if(subpicture_mode == BACKEND_SUBPICTURE){
@@ -1042,7 +1046,7 @@
 int i,cfs;
 
 
-   if( verbose > 3 ) 
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: flip_page  show(rndr=%p)\n\n",p_render_surface_to_show);
 
    if(p_render_surface_to_show == NULL) return;
@@ -1060,7 +1064,7 @@
          return; 
       }
       p_render_surface_to_show=show_queue[0];
-      if(verbose > 4)
+      if( mp_msg_test(MSGT_VO,MSGL_DBG5) )
          printf("vo_xvmc: flip_queue free_element=%d\n",free_element);
       free_element--;
       for(i=0; i<free_element; i++){
@@ -1128,7 +1132,7 @@
 
       subpicture_alloc = 0;
 
-      if(verbose > 3)
+      if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
          printf("vo_xvmc: subpicture destroyed\n");
    }
 
@@ -1154,19 +1158,22 @@
       XvMCDestroyContext(mDisplay,&ctx);
       number_of_surfaces = 0;
 
-      if(verbose > 3) printf("vo_xvmc: Context sucessfuly freed\n");
+      if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
+         printf("vo_xvmc: Context sucessfuly freed\n"); }
    }
 
 
    if( xv_port !=0 ){
       XvUngrabPort(mDisplay,xv_port,CurrentTime);
       xv_port = 0;
-      if(verbose > 3) printf("vo_xvmc: xv_port sucessfuly ungrabed\n");
+      if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
+         printf("vo_xvmc: xv_port sucessfuly ungrabed\n"); }
    }
 }
 
 static void uninit(void){
-   if( verbose > 3 ) printf("vo_xvmc: uninit called\n");
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) {
+      printf("vo_xvmc: uninit called\n"); }
    xvmc_free();
  //from vo_xv
 #ifdef HAVE_XF86VM
@@ -1180,7 +1187,7 @@
 XvMCSurfaceInfo qsurface_info;
 int mode_id;
 
-   if(verbose > 3)
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: query_format=%X\n",format);
 
    if(!IMGFMT_IS_XVMC(format)) return 0;// no caps supported
@@ -1204,7 +1211,7 @@
 xvmc_render_state_t * rndr;
 int rez;
 
-   if(verbose > 3)
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: draw_slice y=%d\n",y);
 
    rndr = (xvmc_render_state_t*)image[2];//this is copy of priv-ate
@@ -1246,7 +1253,7 @@
    }
 #endif
    assert(rez==Success);
-   if(verbose > 3 ) printf("vo_xvmc: flush surface\n");
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) printf("vo_xvmc: flush surface\n");
    rez = XvMCFlushSurface(mDisplay, rndr->p_surface);
    assert(rez==Success);
 
@@ -1266,7 +1273,7 @@
 int stat;
       //If this is source surface, check does the OSD rendering is compleate
       if(src_rndr->state & MP_XVMC_STATE_OSD_SOURCE){
-         if(verbose > 3)
+         if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
             printf("vo_xvmc: OSD surface=%p quering\n",src_rndr);
          osd_rndr = src_rndr->p_osd_target_surface_render;
          XvMCGetSurfaceStatus(mDisplay, osd_rndr->p_surface, &stat);
@@ -1354,7 +1361,7 @@
    rndr->filled_mv_blocks_num = 0;
    rndr->next_free_data_block_num = 0;
 
-   if( verbose > 3 ) 
+   if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
       printf("vo_xvmc: get_image: rndr=%p (surface=%p) \n",
              rndr,rndr->p_surface);
 return VO_TRUE;   

Index: vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- vosub_vidix.c	7 Dec 2005 16:04:14 -0000	1.65
+++ vosub_vidix.c	24 Mar 2006 08:12:02 -0000	1.66
@@ -24,6 +24,7 @@
 #include <errno.h>
 
 #include "config.h"
+#include "mp_msg.h"
 
 #include "vosub_vidix.h"
 #include "vidix/vidixlib.h"
@@ -41,7 +42,6 @@
 static uint8_t *vidix_mem = NULL;
 static uint8_t next_frame;
 static unsigned image_Bpp,image_height,image_width,src_format,forced_fourcc=0;
-extern int verbose;
 static int video_on=0;
 
 static vidix_capability_t vidix_cap;
@@ -84,7 +84,8 @@
 
 void vidix_term( void )
 {
-  if(verbose > 1) printf("vosub_vidix: vidix_term() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vosub_vidix: vidix_term() was called\n"); }
 	vidix_stop();
 	vdlClose(vidix_handler);
 //  ((vo_functions_t *)vo_server)->control=server_control;
@@ -253,7 +254,8 @@
 }
 
 static uint32_t  vidix_draw_image(mp_image_t *mpi){
-    if(verbose > 1) printf("vosub_vidix: vidix_draw_image() was called\n");
+    if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+      printf("vosub_vidix: vidix_draw_image() was called\n"); }
 
     // if -dr or -slices then do nothing:
     if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
@@ -271,7 +273,8 @@
 
 void     vidix_flip_page(void)
 {
-  if(verbose > 1) printf("vosub_vidix: vidix_flip_page() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vosub_vidix: vidix_flip_page() was called\n"); }
   if(vo_doublebuffering)
   {
 	vdlPlaybackFrameSelect(vidix_handler,next_frame);
@@ -331,14 +334,16 @@
 
 void     vidix_draw_osd(void)
 {
-  if(verbose > 1) printf("vosub_vidix: vidix_draw_osd() was called\n");
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vosub_vidix: vidix_draw_osd() was called\n"); }
   /* TODO: hw support */
   vo_draw_text(vidix_play.src.w,vidix_play.src.h,draw_alpha);
 }
 
 uint32_t vidix_query_fourcc(uint32_t format)
 {
-  if(verbose > 1) printf("vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format));
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format)); }
   vidix_fourcc.fourcc = format;
   vdlQueryFourcc(vidix_handler,&vidix_fourcc);
   if (vidix_fourcc.depth == VID_DEPTH_NONE)
@@ -408,7 +413,7 @@
   size_t i;
   int err;
   uint32_t sstride,apitch;
-  if(verbose > 1)
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) )
      printf("vosub_vidix: vidix_init() was called\n"
     	    "src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
 	    "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n"
@@ -492,7 +497,8 @@
 		printf("vosub_vidix: Can't configure playback: %s\n",strerror(err));
 		return -1;
 	}
-	if (verbose) printf("vosub_vidix: using %d buffer(s)\n", vidix_play.num_frames);
+	if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
+		printf("vosub_vidix: using %d buffer(s)\n", vidix_play.num_frames); }
 
 	vidix_mem = vidix_play.dga_addr;
 
@@ -702,7 +708,8 @@
 int vidix_preinit(const char *drvname,void *server)
 {
   int err;
-  if(verbose > 1) printf("vosub_vidix: vidix_preinit(%s) was called\n",drvname);
+  if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) {
+    printf("vosub_vidix: vidix_preinit(%s) was called\n",drvname); }
 	if(vdlGetVersion() != VIDIX_VERSION)
 	{
 	  printf("vosub_vidix: You have wrong version of VIDIX library\n");




More information about the MPlayer-cvslog mailing list