[vlc-commits] direct3d11: use all the RECT used for the picture placement to detect changes

Steve Lhomme git at videolan.org
Tue Aug 1 10:13:58 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Mon Jul 31 15:29:14 2017 +0200| [231b1c2e5ea3cf68fa69e526bb7a6adbe16c5c50] | committer: Jean-Baptiste Kempf

direct3d11: use all the RECT used for the picture placement to detect changes

Otherwise there are some cases where resizing occurs but not updated on the
display.

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

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

 modules/video_output/win32/direct3d11.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 62da3dd839..8be74b4866 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1081,10 +1081,18 @@ static void UpdateSize(vout_display_t *vd)
 #endif
 }
 
+static inline bool RectEquals(const RECT *r1, const RECT *r2)
+{
+    return r1->bottom == r2->bottom && r1->top == r2->top &&
+           r1->left == r2->left && r1->right == r2->right;
+}
+
 static int Control(vout_display_t *vd, int query, va_list args)
 {
     vout_display_sys_t *sys = vd->sys;
-    RECT size_before = sys->sys.rect_dest_clipped;
+    RECT before_src_clipped  = sys->sys.rect_src_clipped;
+    RECT before_dest_clipped = sys->sys.rect_dest_clipped;
+    RECT before_dest         = sys->sys.rect_dest;
 
     int res = CommonControl( vd, query, args );
 
@@ -1098,8 +1106,9 @@ static int Control(vout_display_t *vd, int query, va_list args)
         }
     }
 
-    if (RECTWidth(size_before)  != RECTWidth(sys->sys.rect_dest_clipped) ||
-        RECTHeight(size_before) != RECTHeight(sys->sys.rect_dest_clipped))
+    if (!RectEquals(&before_src_clipped,  &sys->sys.rect_src_clipped) ||
+        !RectEquals(&before_dest_clipped, &sys->sys.rect_dest_clipped) ||
+        !RectEquals(&before_dest,         &sys->sys.rect_dest) )
     {
         UpdateSize(vd);
     }
@@ -1110,12 +1119,15 @@ static int Control(vout_display_t *vd, int query, va_list args)
 static void Manage(vout_display_t *vd)
 {
     vout_display_sys_t *sys = vd->sys;
-    RECT size_before = sys->sys.rect_dest_clipped;
+    RECT before_src_clipped  = sys->sys.rect_src_clipped;
+    RECT before_dest_clipped = sys->sys.rect_dest_clipped;
+    RECT before_dest         = sys->sys.rect_dest;
 
     CommonManage(vd);
 
-    if (RECTWidth(size_before)  != RECTWidth(sys->sys.rect_dest_clipped) ||
-        RECTHeight(size_before) != RECTHeight(sys->sys.rect_dest_clipped))
+    if (!RectEquals(&before_src_clipped, &sys->sys.rect_src_clipped) ||
+        !RectEquals(&before_dest_clipped, &sys->sys.rect_dest_clipped) ||
+        !RectEquals(&before_dest, &sys->sys.rect_dest))
     {
         UpdateSize(vd);
     }



More information about the vlc-commits mailing list