vlc | branch: master | Steve Lhomme <rob...@videolabs.io> | Thu Oct 13 16:53:37 
2016 +0200| [92b4a936d29e9c07a942712987a286643db0fa1f] | committer: 
Jean-Baptiste Kempf

direct3d11: fix the subpicture positions

there's was a mismatch between height/width and missing the offset of the
placed picture in the whole area.

Fixes WinRT issue #37

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/video_output/win32/direct3d11.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index c3c9e59..d551e15 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2048,12 +2048,12 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, 
int *subpicture_region_co
 
         d3d_quad_t *quad = (d3d_quad_t *) quad_picture->p_sys;
 
-        quad->cropViewport.Width =  (FLOAT) r->fmt.i_visible_width * 
RECTHeight(sys->rect_dest) / subpicture->i_original_picture_height;
-        quad->cropViewport.Height = (FLOAT) r->fmt.i_visible_height * 
RECTWidth(sys->rect_dest) / subpicture->i_original_picture_width;
+        quad->cropViewport.Width =  (FLOAT) r->fmt.i_visible_width  * 
RECTWidth(sys->rect_dest)  / subpicture->i_original_picture_width;
+        quad->cropViewport.Height = (FLOAT) r->fmt.i_visible_height * 
RECTHeight(sys->rect_dest) / subpicture->i_original_picture_height;
         quad->cropViewport.MinDepth = 0.0f;
         quad->cropViewport.MaxDepth = 1.0f;
-        quad->cropViewport.TopLeftX = r->i_x * RECTHeight(sys->rect_dest) / 
subpicture->i_original_picture_height;
-        quad->cropViewport.TopLeftY = r->i_y * RECTWidth(sys->rect_dest) / 
subpicture->i_original_picture_width;
+        quad->cropViewport.TopLeftX = sys->rect_dest.left + (FLOAT) r->i_x * 
RECTWidth(sys->rect_dest) / subpicture->i_original_picture_width;
+        quad->cropViewport.TopLeftY = sys->rect_dest.top  + (FLOAT) r->i_y * 
RECTHeight(sys->rect_dest) / subpicture->i_original_picture_height;
 
         UpdateQuadOpacity(vd, quad, r->i_alpha / 255.0f );
     }

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to