[MPlayer-cvslog] r38303 - trunk/libvo/vo_kva.c

komh subversion at mplayerhq.hu
Mon Mar 15 12:56:31 EET 2021


Author: komh
Date: Mon Mar 15 12:56:31 2021
New Revision: 38303

Log:
kva: support -geometry option

Modified:
   trunk/libvo/vo_kva.c

Modified: trunk/libvo/vo_kva.c
==============================================================================
--- trunk/libvo/vo_kva.c	Fri Mar  5 14:28:06 2021	(r38302)
+++ trunk/libvo/vo_kva.c	Mon Mar 15 12:56:31 2021	(r38303)
@@ -812,12 +812,21 @@ static int config(uint32_t width, uint32
             d_height++;
         }
 
-        m_int.rclDst.xLeft   = ((LONG)vo_screenwidth  - (LONG)d_width)  / 2;
-        m_int.rclDst.yBottom = ((LONG)vo_screenheight - (LONG)d_height) / 2;
+        vo_dx = (vo_screenwidth - d_width) / 2;
+        vo_dy = (vo_screenheight - d_height ) / 2;
+        geometry(&vo_dx, &vo_dy, &d_width, &d_height,
+                 vo_screenwidth, vo_screenheight);
+
+        m_int.rclDst.xLeft   = vo_dx;
+        // invert Y
+        m_int.rclDst.yBottom = vo_screenheight - (vo_dy + d_height);
         m_int.rclDst.xRight  = m_int.rclDst.xLeft   + d_width;
         m_int.rclDst.yTop    = m_int.rclDst.yBottom + d_height;
 
         if (vo_fs) {
+            vo_dx = 0;
+            vo_dy = 0;
+
             d_width  = vo_screenwidth;
             d_height = vo_screenheight;
 
@@ -831,10 +840,11 @@ static int config(uint32_t width, uint32
             setAspectRatio(KVAR_FORCEANY);
         }
 
-        rcl.xLeft   = ((LONG)vo_screenwidth  - (LONG)d_width) / 2;
-        rcl.yBottom = ((LONG)vo_screenheight - (LONG)d_height) /2 ;
-        rcl.xRight  = rcl.xLeft              + d_width;
-        rcl.yTop    = rcl.yBottom            + d_height;
+        rcl.xLeft   = vo_dx;
+        // invert Y
+        rcl.yBottom = vo_screenheight - (vo_dy + d_height);
+        rcl.xRight  = rcl.xLeft   + d_width;
+        rcl.yTop    = rcl.yBottom + d_height;
     } else {
         vo_fs = 0;
 


More information about the MPlayer-cvslog mailing list