changeset 6382:86d5fc5b54e2

fix panscan support and add Jesper Svennevid's <mplayer@svennevid.net> patch
author pontscho
date Mon, 10 Jun 2002 18:40:19 +0000
parents e5e288512d8f
children 49f9e6b07687
files libvo/aspect.c libvo/mga_common.c libvo/vo_xmga.c libvo/vo_xv.c libvo/vo_xvidix.c
diffstat 5 files changed, 37 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/aspect.c	Mon Jun 10 16:51:41 2002 +0000
+++ b/libvo/aspect.c	Mon Jun 10 18:40:19 2002 +0000
@@ -101,7 +101,12 @@
 
 void panscan_calc( void )
 {
- int vo_panscan_area = (aspdat.scrh-vo_dheight);
+ int fwidth,fheight;
+ int vo_panscan_area;
+
+ aspect(&fwidth,&fheight,A_ZOOM);
+ vo_panscan_area = (aspdat.scrh-fheight);
+
  vo_panscan_amount = vo_fs ? vo_panscan : 0;
  vo_panscan_x = vo_panscan_area * vo_panscan_amount * aspdat.asp;
  vo_panscan_y = vo_panscan_area * vo_panscan_amount;
--- a/libvo/mga_common.c	Mon Jun 10 16:51:41 2002 +0000
+++ b/libvo/mga_common.c	Mon Jun 10 18:40:19 2002 +0000
@@ -5,7 +5,7 @@
 
 // mga_vid drawing functions
 #ifdef VO_XMGA
-static void set_window( int ps );	/* forward declaration to kill warnings */
+static void set_window( void );	/* forward declaration to kill warnings */
 #endif
 
 static int mga_next_frame=0;
@@ -272,26 +272,33 @@
     return query_format(*((uint32_t*)data));
   case VOCTRL_GET_IMAGE:
     return get_image(data);
+
+#ifndef VO_XMGA
   case VOCTRL_FULLSCREEN:
-#ifdef VO_XMGA
-    vo_x11_fullscreen();
-#else
     mga_fullscreen();
+    return VO_TRUE;
 #endif
-    return VO_TRUE;
+
 #if defined( VO_XMGA ) && defined( HAVE_NEW_GUI )
   case VOCTRL_GUISUPPORT:
     return VO_TRUE;
 #endif
+
 #ifdef VO_XMGA
   case VOCTRL_GET_PANSCAN:
       if ( !inited || !vo_fs ) return VO_FALSE;
       return VO_TRUE;
+  case VOCTRL_FULLSCREEN:
+      vo_x11_fullscreen();
+      vo_panscan_amount=0;
+    /* indended, fallthrough to update panscan on fullscreen/windowed switch */
   case VOCTRL_SET_PANSCAN:
-      if ( vo_fs && ( vo_panscan != vo_panscan_amount ) )
+      if ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) // || ( !vo_fs && vo_panscan_amount ) )
        {
+        int old_y = vo_panscan_y;
 	panscan_calc();
-        set_window( 1 );
+//        if ( old_y != vo_panscan_y ) 
+	set_window();
        }
       return VO_TRUE;
 #endif
--- a/libvo/vo_xmga.c	Mon Jun 10 16:51:41 2002 +0000
+++ b/libvo/vo_xmga.c	Mon Jun 10 18:40:19 2002 +0000
@@ -105,7 +105,7 @@
  XFlush( mDisplay );
 }
 
-static void set_window( int ps ){
+static void set_window( void ){
 
 	 if ( WinID )
 	  {
@@ -163,7 +163,7 @@
          mga_vid_config.y_org=drwcY;
          mga_vid_config.dest_width=drwWidth;
          mga_vid_config.dest_height=drwHeight;
-	 if ( ps )
+	 if ( vo_panscan > 0.0f && vo_fs )
 	  {
 	   drwX-=vo_panscan_x>>1;
 	   drwY-=vo_panscan_y>>1;
@@ -183,7 +183,7 @@
 {
  int e=vo_x11_check_events(mDisplay);
  if ( !(e&VO_EVENT_RESIZE) && !(e&VO_EVENT_EXPOSE) ) return;
- set_window( 0 );
+ set_window();
  mDrawColorKey();
  if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) ) mp_msg(MSGT_VO,MSGL_WARN,"Error in mga_vid_config ioctl (wrong mga_vid.o version?)" );
 }
@@ -323,8 +323,10 @@
   }
 
  if ( ( flags&1 )&&( !WinID ) ) { vo_dx=0; vo_dy=0; vo_dwidth=vo_screenwidth; vo_dheight=vo_screenheight; vo_fs=1; }
+
+ panscan_calc();
  
- set_window( 0 );
+ set_window();
 
  mga_vid_config.src_width=width;
  mga_vid_config.src_height=height;
--- a/libvo/vo_xv.c	Mon Jun 10 16:51:41 2002 +0000
+++ b/libvo/vo_xv.c	Mon Jun 10 18:40:19 2002 +0000
@@ -499,6 +499,8 @@
        vo_dheight=(vo_dheight > vo_screenheight?vo_screenheight:vo_dheight);
        mp_msg(MSGT_VO,MSGL_V, "[xv-fs] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
       }
+
+     panscan_calc();
      
      mp_msg(MSGT_VO,MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
 
--- a/libvo/vo_xvidix.c	Mon Jun 10 16:51:41 2002 +0000
+++ b/libvo/vo_xvidix.c	Mon Jun 10 18:40:19 2002 +0000
@@ -74,7 +74,7 @@
 static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
     drwDepth, drwcX, drwcY, dwidth, dheight;
 
-static void set_window(int force_update,const vo_tune_info_t *info, int ps)
+static void set_window(int force_update,const vo_tune_info_t *info)
 {
     Window mRoot;
     if ( WinID )
@@ -137,7 +137,7 @@
     }
 #endif
 
-    if ( ps )
+    if ( vo_panscan > 0.0f && vo_fs )
      {
       drwcX-=vo_panscan_x >> 1;
       drwcY-=vo_panscan_y >> 1;
@@ -363,12 +363,14 @@
 	vidix_grkey_set(&gr_key);
     }
 
-    set_window(1,info,0);
+    set_window(1,info);
     if(info) memcpy(&vtune,info,sizeof(vo_tune_info_t));
     else     memset(&vtune,0,sizeof(vo_tune_info_t));
     XFlush(mDisplay);
     XSync(mDisplay, False);
 
+    panscan_calc();
+
     saver_off(mDisplay); /* turning off screen saver */
     
     vo_config_count++;
@@ -386,7 +388,7 @@
     const int event = vo_x11_check_events(mDisplay);
 
     if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE))
-	set_window(0,&vtune,0);
+	set_window(0,&vtune);
 
     return;
 }
@@ -463,17 +465,16 @@
     return query_format(*((uint32_t*)data));
   case VOCTRL_GUISUPPORT:
     return VO_TRUE;
-  case VOCTRL_FULLSCREEN:
-    vo_x11_fullscreen();
-    return VO_TRUE;
   case VOCTRL_GET_PANSCAN:
       if ( !vo_config_count || !vo_fs ) return VO_FALSE;
       return VO_TRUE;
+  case VOCTRL_FULLSCREEN:
+      vo_x11_fullscreen();
   case VOCTRL_SET_PANSCAN:
       if ( vo_fs && ( vo_panscan != vo_panscan_amount ) )
         {
          panscan_calc();
-	 set_window( 0,&vtune,1 );
+	 set_window( 0,&vtune );
         }
       return VO_TRUE;
   }