diff options
author | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-01-09 15:25:24 +0000 |
---|---|---|
committer | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-01-09 15:25:24 +0000 |
commit | 0fa2d1abd78aba49a33b0f6dd6f7f2738a179d4e (patch) | |
tree | 529ed18ba6b905f347d4c5791634ee52f661b6c2 /libvo/x11_common.c | |
parent | 84b4007802282135bc64d569c8fcec291465b515 (diff) | |
download | mpv-0fa2d1abd78aba49a33b0f6dd6f7f2738a179d4e.tar.bz2 mpv-0fa2d1abd78aba49a33b0f6dd6f7f2738a179d4e.tar.xz |
Factor calc_drwXY out of vo_xv and vo_xvmc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28285 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r-- | libvo/x11_common.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 9b6ee47b9b..919dec5c1f 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -8,6 +8,7 @@ #include "config.h" #include "mp_msg.h" #include "mp_fifo.h" +#include "libavutil/common.h" #include "x11_common.h" #ifdef X11_FULLSCREEN @@ -1854,6 +1855,23 @@ uint32_t vo_x11_get_equalizer(char *name, int *value) return VO_TRUE; } +void vo_calc_drwXY(uint32_t *drwX, uint32_t *drwY) +{ + *drwX = *drwY = 0; + if (vo_fs) { + aspect(&vo_dwidth, &vo_dheight, A_ZOOM); + vo_dwidth = FFMIN(vo_dwidth, vo_screenwidth); + vo_dheight = FFMIN(vo_dheight, vo_screenheight); + *drwX = (vo_screenwidth - vo_dwidth) / 2; + *drwY = (vo_screenheight - vo_dheight) / 2; + mp_msg(MSGT_VO, MSGL_V, "[vo-fs] dx: %d dy: %d dw: %d dh: %d\n", + *drwX, *drwY, vo_dwidth, vo_dheight); + } else if (WinID == 0) { + *drwX = vo_dx; + *drwY = vo_dy; + } +} + #ifdef CONFIG_XV int vo_xv_set_eq(uint32_t xv_port, char *name, int value) { |