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

Steve Lhomme git at videolan.org
Wed Sep 9 14:05:27 CEST 2015


vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Fri Aug 28 09:17:28 2015 +0200| [fbcd354f0a50df6018e0965d3ef7e51b5fb2187c] | committer: Jean-Baptiste Kempf

direct3d11: fix the subpictures position on Winstore apps

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fbcd354f0a50df6018e0965d3ef7e51b5fb2187c
---

 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;
 }



More information about the vlc-commits mailing list