[Mplayer-cvslog] CVS: main/libvo vo_vesa.c,1.57,1.58 vosub_vidix.c,1.18,1.19

Nick Kurshev nick at mplayer.dev.hu
Sat Jan 26 20:12:52 CET 2002


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

Modified Files:
	vo_vesa.c vosub_vidix.c 
Log Message:
preinit usage

Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- vo_vesa.c	26 Jan 2002 16:01:26 -0000	1.57
+++ vo_vesa.c	26 Jan 2002 19:12:49 -0000	1.58
@@ -105,7 +105,6 @@
 #ifdef CONFIG_VIDIX
 static const char *vidix_name = NULL;
 #endif
-static int pre_init_err = 0;
 
 #define HAS_DGA()  (win.idx == -1)
 #define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS)
@@ -411,6 +410,7 @@
 
 #define SUBDEV_NODGA     0x00000001UL
 #define SUBDEV_FORCEDGA  0x00000002UL
+static uint32_t subdev_flags = 0xFFFFFFFEUL;
 static uint32_t parseSubDevice(const char *sd)
 {
    uint32_t flags;
@@ -430,30 +430,9 @@
 
 static uint32_t query_format(uint32_t format)
 {
-  static int first = 1;
   uint32_t retval;
     if(verbose > 2)
         printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
-    if(first)
-    {
-      if(verbose > 2)
-        printf("vo_vesa: subdevice %s have been initialized\n",vo_subdevice);
-      if(vo_subdevice) parseSubDevice(vo_subdevice);
-      if(lvo_name) pre_init_err = vlvo_preinit(lvo_name);
-#ifdef CONFIG_VIDIX
-      else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,&video_out_vesa);
-#endif
-      if(verbose > 2)
-        printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
-      first = 0;
-    }
-    if(!pre_init_err) 
-    {
-      if(lvo_name) return vlvo_query_info(format);
-#ifdef CONFIG_VIDIX
-      else if(vidix_name) return vidix_query_fourcc(format);
-#endif
-    }
 	switch(format)
 	{
 		case IMGFMT_YV12:
@@ -568,7 +547,7 @@
   struct VbeInfoBlock vib;
   struct VesaModeInfoBlock vmib;
   size_t i,num_modes;
-  uint32_t w,h, sd_flags;
+  uint32_t w,h;
   unsigned short *mode_ptr,win_seg;
   unsigned bpp,best_x = UINT_MAX,best_y=UINT_MAX,best_mode_idx = UINT_MAX;
   int err,fs_mode,yuv_fmt;
@@ -576,14 +555,12 @@
 	image_height = height;
 	fs_mode = 0;
 	rgb2rgb_fnc = NULL;
-        sd_flags = 0;
-	if(pre_init_err)
+        if(subdev_flags == 0xFFFFFFFEUL)
 	{
-	  printf("vo_vesa: initialization have been terminated due wrong preinitialization\n");
+	  printf("vo_vesa: detected internal fatal error: init is called before preinit\n");
 	  return -1;
-	}  
-        if(vo_subdevice) sd_flags = parseSubDevice(vo_subdevice);
-	if(sd_flags == -1) return -1;
+	}
+	if(subdev_flags == -1) return -1;
 	if(flags & 0x8)
 	{
 	  printf("vo_vesa: switch -flip is not supported\n");
@@ -733,7 +710,7 @@
 		printf("vo_vesa: Using VESA mode (%u) = %x [%ux%u@%u]\n"
 			,best_mode_idx,video_mode,video_mode_info.XResolution
 			,video_mode_info.YResolution,video_mode_info.BitsPerPixel);
-		if(sd_flags & SUBDEV_NODGA) video_mode_info.PhysBasePtr = 0;
+		if(subdev_flags & SUBDEV_NODGA) video_mode_info.PhysBasePtr = 0;
 		if( vesa_zoom || fs_mode )
 		{
 		  if(format==IMGFMT_YV12 || lvo_name
@@ -837,7 +814,7 @@
 		}
 		if(!HAS_DGA())
 		{
-		  if(sd_flags & SUBDEV_FORCEDGA)
+		  if(subdev_flags & SUBDEV_FORCEDGA)
 		  {
 			printf("vo_vesa: you've forced DGA. Exiting\n");
 			return -1;
@@ -991,7 +968,19 @@
 
 static uint32_t preinit(const char *arg)
 {
-  return 0;
+  int pre_init_err = 0;
+  if(verbose>1) printf("vo_vesa: preinit(%s) was called\n",arg);
+  if(verbose > 2)
+        printf("vo_vesa: subdevice %s is being initialized\n",arg);
+  subdev_flags = 0;
+  if(arg) subdev_flags = parseSubDevice(arg);
+  if(lvo_name) pre_init_err = vlvo_preinit(lvo_name);
+#ifdef CONFIG_VIDIX
+  else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,&video_out_vesa);
+#endif
+  if(verbose > 2)
+        printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
+  return pre_init_err;
 }
 
 static void query_vaa(vo_vaa_t *vaa)

Index: vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- vosub_vidix.c	23 Jan 2002 19:32:52 -0000	1.18
+++ vosub_vidix.c	26 Jan 2002 19:12:49 -0000	1.19
@@ -71,6 +71,7 @@
 	((vo_functions_t *)server)->draw_frame=vidix_draw_frame;
 	((vo_functions_t *)server)->flip_page=vidix_flip_page;
 	((vo_functions_t *)server)->draw_osd=vidix_draw_osd;
+	((vo_functions_t *)server)->query_format=vidix_query_fourcc;
 	return 0;
 }
 




More information about the MPlayer-cvslog mailing list