video: do not align source position to 2

vo_direct3d still seems to require this (tested on Windows 8.1 with
Intel graphics). Do it in vo_direct3d instead of messing with all VOs.
This commit is contained in:
wm4 2015-05-21 19:27:54 +02:00
parent cf023e1f3a
commit af667643a0
2 changed files with 11 additions and 11 deletions

View File

@ -67,10 +67,6 @@ static void clamp_size(int size, int *start, int *end)
}
}
// Round source to a multiple of 2, this is at least needed for vo_direct3d
// and ATI cards.
#define VID_SRC_ROUND_UP(x) (((x) + 1) & ~1)
static void src_dst_split_scaling(int src_size, int dst_size,
int scaled_src_size, bool unscaled,
float zoom, float align, float pan,
@ -100,12 +96,12 @@ static void src_dst_split_scaling(int src_size, int dst_size,
int s_dst = *dst_end - *dst_start;
if (*dst_start < 0) {
int border = -(*dst_start) * s_src / s_dst;
*src_start += VID_SRC_ROUND_UP(border);
*src_start += border;
*dst_start = 0;
}
if (*dst_end > dst_size) {
int border = (*dst_end - dst_size) * s_src / s_dst;
*src_end -= VID_SRC_ROUND_UP(border);
*src_end -= border;
*dst_end = dst_size;
}

View File

@ -887,6 +887,9 @@ static uint32_t d3d_draw_frame(d3d_priv *priv)
if (!priv->have_image)
goto render_osd;
RECT rm = priv->fs_movie_rect;
RECT rs = priv->fs_panscan_rect;
if (priv->use_textures) {
for (n = 0; n < priv->plane_count; n++) {
@ -894,9 +897,6 @@ static uint32_t d3d_draw_frame(d3d_priv *priv)
d3dtex_get_render_texture(priv, &priv->planes[n].texture));
}
RECT rm = priv->fs_movie_rect;
RECT rs = priv->fs_panscan_rect;
vertex_video vb[] = {
{ rm.left, rm.top, 0.0f},
{ rm.right, rm.top, 0.0f},
@ -941,11 +941,15 @@ static uint32_t d3d_draw_frame(d3d_priv *priv)
}
} else {
rs.left &= ~(ULONG)1;
rs.top &= ~(ULONG)1;
rs.right &= ~(ULONG)1;
rs.bottom &= ~(ULONG)1;
if (FAILED(IDirect3DDevice9_StretchRect(priv->d3d_device,
priv->d3d_surface,
&priv->fs_panscan_rect,
&rs,
priv->d3d_backbuf,
&priv->fs_movie_rect,
&rm,
D3DTEXF_LINEAR))) {
MP_ERR(priv, "Copying frame to the backbuffer failed.\n");
return VO_ERROR;