[MPlayer-users] Little patch to get the -geometry option working on 0.90rc2 (and others)

Henk henk at god.dyndns.org
Sun Dec 29 23:54:03 CET 2002


Hi,

The -geometry option isn't working on the libvo driver 0.90rc2 and
before.

In order to get full screen tvout (with nvidia) working on my tv I need
to use the -geometry option. because the tv picture shows only part of
the monitor screen.

The patch  below seems to do the trick, added the geometyr(..) function
to the vo_vx config function.

In my opinion it would be a good idea to standardise -geometry to X
conventions so we can write:
   mplayer -geometry 730x550+23+0
instead of:
   mplayer -geometry 23:0 -x 730 -y 550

And lose two options and lose some maintenace in the documentation ;)


MPlayer great package, thanks!

Kind regards,

Henk


BTW. is there a way to get rid of the frame border ? Still seeing a
little of the window border on top of my tvscreen....

-------------- next part --------------
--- MPlayer-0.90rc2/libvo/vo_xv.c.orig	Sun Dec 29 23:07:21 2002
+++ MPlayer-0.90rc2/libvo/vo_xv.c	Sun Dec 29 23:15:41 2002
@@ -278,12 +278,17 @@
  image_height = height;
  image_width = width;
  image_format=format;
- 
+
  vo_mouse_autohide=1;
 
- vo_dx=( vo_screenwidth - d_width ) / 2; vo_dy=( vo_screenheight - d_height ) / 2;
+ // Quick fix for handling the geometry option.
+ if(!geometry(&vo_dx, &vo_dy, vo_screenwidth, vo_screenheight, d_width, d_height,0)) {
+	vo_dx=( vo_screenwidth - d_width ) / 2;
+	vo_dy=( vo_screenheight - d_height ) / 2;
+ }
+
  vo_dwidth=d_width; vo_dheight=d_height;
-     
+
 #ifdef HAVE_XF86VM
  if( flags&0x02 ) vm = 1;
 #endif
@@ -298,7 +303,7 @@
        if (fo[i].id == format) xv_format = fo[i].id;
      }
      if (!xv_format) return -1;
- 
+
  aspect_save_screenres(vo_screenwidth,vo_screenheight);
 
 #ifdef HAVE_NEW_GUI
@@ -405,7 +410,7 @@
   }
 
      mp_msg(MSGT_VO,MSGL_V, "using Xvideo port %d for hw scaling\n",xv_port );
-       
+
        switch (xv_format){
 	case IMGFMT_YV12:  
 	case IMGFMT_I420:
@@ -516,7 +521,7 @@
         XClearWindow(mDisplay, vo_window);
         XFlush(mDisplay);
       }
-      
+
    XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&vo_dwidth,&vo_dheight,&drwBorderWidth,&drwDepth );
    drwX = drwY = 0;
    mp_msg(MSGT_VO,MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
@@ -588,7 +593,7 @@
 
  x/=2;y/=2;w/=2;h/=2;
 
- dst = xvimage[current_buf]->data + xvimage[current_buf]->offsets[1] + 
+ dst = xvimage[current_buf]->data + xvimage[current_buf]->offsets[1] +
        xvimage[current_buf]->pitches[1]*y + x;
  if(image_format!=IMGFMT_YV12)
    memcpy_pic(dst, image[1], w, h, xvimage[current_buf]->pitches[1], stride[1]);
@@ -699,7 +704,7 @@
      return 0;
 }
 
-static void uninit(void) 
+static void uninit(void)
 {
  int i;
  if ( !vo_config_count ) return;


More information about the MPlayer-users mailing list