[vlc-devel] [PATCH] display: only call CheckReset if Reset wasn't called

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 24 11:17:16 CEST 2019


No need to call Reset twice if the module (d3d9) requested a reset.
---
 src/video_output/display.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 556406f7c6d..f69cfd08c79 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -619,8 +619,8 @@ void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t
 
     if (err1 || err2)
         vout_display_Reset(vd);
-
-    vout_display_CheckReset(vd);
+    else
+        vout_display_CheckReset(vd);
 }
 
 void vout_display_SetSize(vout_display_t *vd, unsigned width, unsigned height)
@@ -631,7 +631,8 @@ void vout_display_SetSize(vout_display_t *vd, unsigned width, unsigned height)
     osys->cfg.display.height = height;
     if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &osys->cfg))
         vout_display_Reset(vd);
-    vout_display_CheckReset(vd);
+    else
+        vout_display_CheckReset(vd);
 }
 
 void vout_SetDisplayFilled(vout_display_t *vd, bool is_filled)
@@ -645,7 +646,8 @@ void vout_SetDisplayFilled(vout_display_t *vd, bool is_filled)
     if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
                              &osys->cfg))
         vout_display_Reset(vd);
-    vout_display_CheckReset(vd);
+    else
+        vout_display_CheckReset(vd);
 }
 
 void vout_SetDisplayZoom(vout_display_t *vd, unsigned num, unsigned den)
@@ -660,7 +662,8 @@ void vout_SetDisplayZoom(vout_display_t *vd, unsigned num, unsigned den)
     osys->cfg.zoom.den = den;
     if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_ZOOM, &osys->cfg))
         vout_display_Reset(vd);
-    vout_display_CheckReset(vd);
+    else
+        vout_display_CheckReset(vd);
 }
 
 void vout_SetDisplayAspect(vout_display_t *vd, unsigned dar_num, unsigned dar_den)
@@ -679,7 +682,8 @@ void vout_SetDisplayAspect(vout_display_t *vd, unsigned dar_num, unsigned dar_de
 
     if (vout_SetSourceAspect(vd, sar_num, sar_den))
         vout_display_Reset(vd);
-    vout_display_CheckReset(vd);
+    else
+        vout_display_CheckReset(vd);
 }
 
 void vout_SetDisplayCrop(vout_display_t *vd,
@@ -702,7 +706,8 @@ void vout_SetDisplayCrop(vout_display_t *vd,
 
         if (vout_UpdateSourceCrop(vd))
             vout_display_Reset(vd);
-        vout_display_CheckReset(vd);
+        else
+            vout_display_CheckReset(vd);
     }
 }
 
-- 
2.17.1



More information about the vlc-devel mailing list