[Mplayer-cvslog] CVS: main/libvo aspect.c,1.10,1.11 mga_common.c,1.36,1.37 vo_xmga.c,1.72,1.73 vo_xv.c,1.97,1.98 vo_xvidix.c,1.40,1.41

Zoltan Ponekker pontscho at mplayerhq.hu
Mon Jun 10 20:40:22 CEST 2002


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

Modified Files:
	aspect.c mga_common.c vo_xmga.c vo_xv.c vo_xvidix.c 
Log Message:
fix panscan support and add Jesper Svennevid's <mplayer at svennevid.net> patch

Index: aspect.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aspect.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- aspect.c	7 Jun 2002 22:43:27 -0000	1.10
+++ aspect.c	10 Jun 2002 18:40:19 -0000	1.11
@@ -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;

Index: mga_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/mga_common.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- mga_common.c	7 Jun 2002 22:43:27 -0000	1.36
+++ mga_common.c	10 Jun 2002 18:40:19 -0000	1.37
@@ -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();
-#endif
     return VO_TRUE;
+#endif
+
 #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

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- vo_xmga.c	6 Jun 2002 07:13:57 -0000	1.72
+++ vo_xmga.c	10 Jun 2002 18:40:19 -0000	1.73
@@ -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;

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- vo_xv.c	9 Jun 2002 23:45:12 -0000	1.97
+++ vo_xv.c	10 Jun 2002 18:40:19 -0000	1.98
@@ -498,6 +498,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 );
 

Index: vo_xvidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xvidix.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- vo_xvidix.c	6 Jun 2002 07:13:57 -0000	1.40
+++ vo_xvidix.c	10 Jun 2002 18:40:19 -0000	1.41
@@ -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;
   }




More information about the MPlayer-cvslog mailing list