[vlc-devel] [PATCH] direct3d11: fix the subpictures position on Winstore apps

Steve Lhomme robux4 at gmail.com
Fri Aug 28 09:17:28 CEST 2015


--
replaces https://patches.videolan.org/patch/9676/
---
 modules/video_output/msw/direct3d11.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index a995c67..8185ab0 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -142,8 +142,8 @@ typedef struct d3d_vertex_t {
     FLOAT       opacity;
 } d3d_vertex_t;
 
-#define RECTWidth(r)   (int)(r.right - r.left)
-#define RECTHeight(r)  (int)(r.bottom - r.top)
+#define RECTWidth(r)   (int)((r).right - (r).left)
+#define RECTHeight(r)  (int)((r).bottom - (r).top)
 
 static int  Open(vlc_object_t *);
 static void Close(vlc_object_t *object);
@@ -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;
 
         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,
-                           i_original_width, i_original_height, opacity);
+            RECTWidth( *p_viewport ), RECTHeight( *p_viewport ), opacity );
     }
     return VLC_SUCCESS;
 }
-- 
2.5.0



More information about the vlc-devel mailing list