summaryrefslogtreecommitdiffstats
path: root/libvo/vo_direct3d.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-13 03:52:51 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-02-13 03:52:51 +0200
commit738f66b1bc98073d74af7031c4454322157a15ec (patch)
tree25d69a5d92ea4440f7e08e3c82cc5bb3a1d4598e /libvo/vo_direct3d.c
parent1e869638280f962fb80f372d152234f21246c2af (diff)
parent9f8792e639fee0b706dc5ec83e9b9fa0cf432e61 (diff)
downloadmpv-738f66b1bc98073d74af7031c4454322157a15ec.tar.bz2
mpv-738f66b1bc98073d74af7031c4454322157a15ec.tar.xz
Merge svn changes up to r28549
Diffstat (limited to 'libvo/vo_direct3d.c')
-rw-r--r--libvo/vo_direct3d.c53
1 files changed, 12 insertions, 41 deletions
diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c
index f41102ab4b..ef1d0ba9dc 100644
--- a/libvo/vo_direct3d.c
+++ b/libvo/vo_direct3d.c
@@ -147,47 +147,18 @@ typedef enum back_buffer_action {
*/
static void calc_fs_rect(void)
{
- int scaled_height = 0;
- int scaled_width = 0;
-
- // set default values
- priv->fs_movie_rect.left = 0;
- priv->fs_movie_rect.right = vo_dwidth;
- priv->fs_movie_rect.top = 0;
- priv->fs_movie_rect.bottom = vo_dheight;
- priv->fs_panscan_rect.left = 0;
- priv->fs_panscan_rect.right = priv->src_width;
- priv->fs_panscan_rect.top = 0;
- priv->fs_panscan_rect.bottom = priv->src_height;
- if (!vo_fs)
- return;
-
- // adjust for fullscreen aspect and panscan
- aspect(&scaled_width, &scaled_height, A_ZOOM);
- panscan_calc();
- scaled_width += vo_panscan_x;
- scaled_height += vo_panscan_y;
-
- // note: border is rounded to a multiple of two since at least
- // ATI drivers can not handle odd values with YV12 input
- if (scaled_width > vo_dwidth) {
- int border = priv->src_width * (scaled_width - vo_dwidth) / scaled_width;
- border = (border / 2 + 1) & ~1;
- priv->fs_panscan_rect.left = border;
- priv->fs_panscan_rect.right = priv->src_width - border;
- } else {
- priv->fs_movie_rect.left = (vo_dwidth - scaled_width) / 2;
- priv->fs_movie_rect.right = priv->fs_movie_rect.left + scaled_width;
- }
- if (scaled_height > vo_dheight) {
- int border = priv->src_height * (scaled_height - vo_dheight) / scaled_height;
- border = (border / 2 + 1) & ~1;
- priv->fs_panscan_rect.top = border;
- priv->fs_panscan_rect.bottom = priv->src_height - border;
- } else {
- priv->fs_movie_rect.top = (vo_dheight - scaled_height) / 2;
- priv->fs_movie_rect.bottom = priv->fs_movie_rect.top + scaled_height;
- }
+ struct vo_rect src_rect;
+ struct vo_rect dst_rect;
+ calc_src_dst_rects(priv->src_width, priv->src_height, &src_rect, &dst_rect, NULL);
+
+ priv->fs_movie_rect.left = dst_rect.left;
+ priv->fs_movie_rect.right = dst_rect.right;
+ priv->fs_movie_rect.top = dst_rect.top;
+ priv->fs_movie_rect.bottom = dst_rect.bottom;
+ priv->fs_panscan_rect.left = src_rect.left;
+ priv->fs_panscan_rect.right = src_rect.right;
+ priv->fs_panscan_rect.top = src_rect.top;
+ priv->fs_panscan_rect.bottom = src_rect.bottom;
mp_msg(MSGT_VO, MSGL_V,
"<vo_direct3d>Fullscreen movie rectangle: t: %ld, l: %ld, r: %ld, b:%ld\n",