changeset 4125:88de258b3ea9

fixed vidix_name handling (subdevice)
author alex
date Sun, 13 Jan 2002 00:23:47 +0000
parents 562b43b604d4
children 5ee0a20cc791
files libvo/vo_xvidix.c
diffstat 1 files changed, 26 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xvidix.c	Sat Jan 12 23:30:20 2002 +0000
+++ b/libvo/vo_xvidix.c	Sun Jan 13 00:23:47 2002 +0000
@@ -43,7 +43,7 @@
 static int X_already_started = 0;
 
 /* VIDIX related stuff */
-static const char *vidix_name = NULL;
+static const char *vidix_name = (char *)(-1);
 
 /* Image parameters */
 static uint32_t image_width;
@@ -84,6 +84,8 @@
 	    vidix_term();
 	    uninit();
     	    exit(1); /* !!! */
+	    x = window_width;
+	    y = window_height;
 	}
     }
     
@@ -112,14 +114,10 @@
     unsigned long xswamask;
     XWindowAttributes attribs;
     int window_depth;
-	
-    if (!vo_subdevice)
-        mp_msg(MSGT_VO, MSGL_INFO, "No vidix driver name provided, probing available drivers!\n");
-    else
-        vidix_name = strdup(vo_subdevice);
-	    
-    if (!title)
-        title = strdup("X11/VIDIX");
+
+//    if (title)
+//	free(title);
+    title = strdup("MPlayer VIDIX X11 Overlay");
 
     image_height = height;
     image_width = width;
@@ -219,9 +217,11 @@
 
     /* Map window. */
     XMapWindow(mDisplay, mywindow);
+#if 0
 #ifdef HAVE_XINERAMA
     vo_x11_xinerama_move(mDisplay, mywindow);
 #endif
+#endif
 
     /* Wait for map. */
     do 
@@ -278,13 +278,17 @@
     XDestroyWindow(mDisplay, mywindow);
     XCloseDisplay(mDisplay);
     X_already_started = 0;
+
+    return;
 }
 
 static void check_events(void)
 {
     const int event = vo_x11_check_events(mDisplay);
+
     if (event & VO_EVENT_RESIZE)
 	resize(vo_dwidth, vo_dheight);
+    return;
 }
 
 /* draw_osd, flip_page, draw_slice, draw_frame should be
@@ -316,7 +320,19 @@
 
 static uint32_t query_format(uint32_t format)
 {
-    vidix_preinit(vidix_name, &video_out_xvidix);
+    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)
+	return(0);
     
     return(vidix_query_fourcc(format));
 }