Commit fbcd354f authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: fix the subpictures position on Winstore apps

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e0457843
...@@ -142,8 +142,8 @@ typedef struct d3d_vertex_t { ...@@ -142,8 +142,8 @@ typedef struct d3d_vertex_t {
FLOAT opacity; FLOAT opacity;
} d3d_vertex_t; } d3d_vertex_t;
#define RECTWidth(r) (int)(r.right - r.left) #define RECTWidth(r) (int)((r).right - (r).left)
#define RECTHeight(r) (int)(r.bottom - r.top) #define RECTHeight(r) (int)((r).bottom - (r).top)
static int Open(vlc_object_t *); static int Open(vlc_object_t *);
static void Close(vlc_object_t *object); static void Close(vlc_object_t *object);
...@@ -1758,9 +1758,14 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co ...@@ -1758,9 +1758,14 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co
dst.bottom = dst.top + scale_h * r->fmt.i_visible_height; dst.bottom = dst.top + scale_h * r->fmt.i_visible_height;
float opacity = (float)r->i_alpha / 255.0f; float opacity = (float)r->i_alpha / 255.0f;
const RECT *p_viewport;
#if VLC_WINSTORE_APP
p_viewport = &sys->rect_display;
#else
p_viewport = &video;
#endif
UpdateQuadPosition(vd, (d3d_quad_t *)quad_picture->p_sys, &dst, UpdateQuadPosition(vd, (d3d_quad_t *)quad_picture->p_sys, &dst,
i_original_width, i_original_height, opacity); RECTWidth( *p_viewport ), RECTHeight( *p_viewport ), opacity );
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment