[Mplayer-cvslog] CVS: main/libvo vo_xvidix.c,1.12,1.13

Alex Beregszaszi alex at mplayer.dev.hu
Sat Jan 26 20:42:24 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv437

Modified Files:
	vo_xvidix.c 
Log Message:
preinit moved to right place

Index: vo_xvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvidix.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- vo_xvidix.c	26 Jan 2002 16:01:26 -0000	1.12
+++ vo_xvidix.c	26 Jan 2002 19:42:21 -0000	1.13
@@ -49,13 +49,14 @@
 static Window mWindow;
 static int X_already_started = 0;
 
+/* Colorkey handling */
 static GC mGC;
 static XGCValues mGCV;
 static uint32_t	fgColor;
+static vidix_grkey_t gr_key;
 
-/* VIDIX related stuff */
-static const char *vidix_name = (char *)(-1);
-static int pre_init_err = 0;
+/* VIDIX related */
+static char *vidix_name;
 
 /* Image parameters */
 static uint32_t image_width;
@@ -67,13 +68,11 @@
 static uint32_t window_x, window_y;
 static uint32_t window_width, window_height;
 
-/* used by XGetGeometry & XTranslateCoordinates */
+/* used by XGetGeometry & XTranslateCoordinates for moving/resizing window */
 static Window mRoot;
 static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
     drwDepth, drwcX, drwcY, dwidth, dheight, mFullscreen;
 
-static vidix_grkey_t gr_key;
-
 static void set_window(int force_update)
 {
 #ifdef HAVE_NEW_GUI
@@ -169,7 +168,6 @@
     mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] window properties: pos: %dx%d, size: %dx%d\n",
 	window_x, window_y, window_width, window_height);
 
-
     /* mDrawColorKey: */
 
     /* fill drawable with specified color */
@@ -195,11 +193,6 @@
     XWindowAttributes attribs;
     int window_depth;
 
-    if(pre_init_err)
-    {
-	mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] Quiting due preinit error\n");
-	return -1;
-    }
 //    if (title)
 //	free(title);
     title = strdup("MPlayer VIDIX X11 Overlay");
@@ -390,7 +383,6 @@
     return(&vo_info);
 }
 
-
 static void check_events(void)
 {
     const int event = vo_x11_check_events(mDisplay);
@@ -437,31 +429,9 @@
 
 static uint32_t query_format(uint32_t format)
 {
-  static int first = 1;
-  if(first)
-  {
-    first = 0;
-    if (vidix_name == (char *)(-1))
-    {
-	if (vo_subdevice)
-	    vidix_name = strdup(vo_subdevice);
-	else
-	{
-    	    mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available drivers!\n");
-	    vidix_name = NULL;
-	}
-    }
-
-    if (vidix_preinit(vidix_name, &video_out_xvidix) != 0)
-    {
-	pre_init_err = 1;
-	return(0);
-    }
-  }    
-  return(pre_init_err ? 0 : vidix_query_fourcc(format));
+  return(vidix_query_fourcc(format));
 }
 
-
 static void uninit(void)
 {
     vidix_term();
@@ -493,7 +463,18 @@
 
 static uint32_t preinit(const char *arg)
 {
-  return 0;
+    if (arg)
+        vidix_name = strdup(arg);
+    else
+    {
+	mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available ones!\n");
+	vidix_name = NULL;
+    }
+
+    if (vidix_preinit(vidix_name, &video_out_xvidix) != 0)
+	return(1);
+
+    return(0);
 }
 
 static void query_vaa(vo_vaa_t *vaa)




More information about the MPlayer-cvslog mailing list