[MPlayer-dev-eng] [PATCH] directx auto-calculate monitoraspect
Joey Parrish
joey at nicewarrior.org
Thu Dec 16 13:40:58 CET 2004
Hello,
Here's a patch to auto-calculate the monitoraspect in vo_directx. This
is done the same way in vo_quartz. I will commit soon if there are no
objections.
This patch depends on the colorkey patch because I diff'd my tree in
that order. I've attached the colorkey patch to this thread for
convenience.
--Joey
--
"I know Kung Fu." --Darth Vader
-------------- next part --------------
diff -ur main.sofar/libvo/vo_directx.c main.dev/libvo/vo_directx.c
--- main.sofar/libvo/vo_directx.c 2004-12-08 20:02:42.667761600 -0600
+++ main.dev/libvo/vo_directx.c 2004-12-08 19:45:09.846665600 -0600
@@ -79,6 +79,7 @@
extern int vo_ontop;
extern int vo_rootwin;
extern int vidmode;
+extern int vo_colorkey;
/*****************************************************************************
* DirectDraw GUIDs.
@@ -978,6 +987,7 @@
monitor_rect.right=GetSystemMetrics(SM_CXSCREEN);
monitor_rect.bottom=GetSystemMetrics(SM_CYSCREEN);
+ windowcolor = vo_colorkey;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
-------------- next part --------------
diff -ur main.sofar/libvo/vo_directx.c main.dev/libvo/vo_directx.c
--- main.sofar/libvo/vo_directx.c 2004-12-08 20:02:42.667761600 -0600
+++ main.dev/libvo/vo_directx.c 2004-12-08 19:45:09.846665600 -0600
@@ -80,6 +80,7 @@
extern int vo_rootwin;
extern int vidmode;
extern int vo_colorkey;
+extern float monitor_aspect;
/*****************************************************************************
* DirectDraw GUIDs.
@@ -1196,6 +1210,7 @@
RECT rd;
vo_screenwidth = monitor_rect.right - monitor_rect.left;
vo_screenheight = monitor_rect.bottom - monitor_rect.top;
+ monitor_aspect = (float)vo_screenwidth / (float)vo_screenheight;
vo_fs = options & 0x01;
image_format = format;
image_width = width;
More information about the MPlayer-dev-eng
mailing list