[MPlayer-dev-eng] svgalib driver

Matan Ziv-Av matan at svgalib.org
Sat Nov 17 21:41:53 CET 2001


Hi,

The following patch for vo_svga.c allows the use of -vo svga:<mode> to
force the driver to use specific mode. ( <mode> is either a mode number,
or an svgalib mode string - 34 or G800x600x16M32).

The patch also moves the setlinearaddressing from before the call to
setmode to after that call, since that is the prefered sequence.

-- 
Matan Ziv-Av.                         matan at svgalib.org


*** org/MPlayer-20011117/libvo/vo_svga.c	Tue Nov  6 13:21:08 2001
--- MPlayer-20011117/libvo/vo_svga.c	Sat Nov 17 22:30:00 2001
***************
*** 285,298 ****
      list = list->next;
    }
  
    if (verbose)
      printf("vo_svga: vid_mode: %d\n",vid_mode);
-   vga_setlinearaddressing();
    if (vga_setmode(vid_mode) == -1) {
      printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode);
      uninit();
      return(1); // error
    } 
    if (gl_setcontextvga(vid_mode)) {
      printf("vo_svga: gl_setcontextvga(%d) failed.\n",vid_mode);
      uninit();
--- 285,332 ----
      list = list->next;
    }
  
+   if(vo_subdevice) {
+       int vm;
+       vm=vga_getmodenumber(vo_subdevice);
+       list=modelist;
+       while(list) {
+           if(list->modenum == vm) {
+              buf_w = list->modeinfo.width;
+              buf_h = list->modeinfo.height;
+ 	     res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
+              switch(list->modeinfo.colors) {
+                  case 32768:
+                      bpp=16;
+                      bpp_conv=1;
+                      break;
+                  case 65536:
+                      bpp=16;
+                      bpp_conv=0;
+                      break;
+                  case (1<<24):
+                      if(list->modeinfo.bytesperpixel == 3) {
+                          bpp=32;
+                          bpp_conv=1;
+                      } else {
+                          bpp=32;
+                          bpp_conv=0;
+                      }
+                      break;
+              }
+              vid_mode=vm;
+              list=NULL;
+       	  } else list=list->next;
+       }
+   }
+ 
    if (verbose)
      printf("vo_svga: vid_mode: %d\n",vid_mode);
    if (vga_setmode(vid_mode) == -1) {
      printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode);
      uninit();
      return(1); // error
    } 
+   vga_setlinearaddressing();
    if (gl_setcontextvga(vid_mode)) {
      printf("vo_svga: gl_setcontextvga(%d) failed.\n",vid_mode);
      uninit();






More information about the MPlayer-dev-eng mailing list