[vlc-commits] display: clip zoom before waking thread

Rémi Denis-Courmont git at videolan.org
Sat Sep 2 19:23:12 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 28 18:17:23 2017 +0300| [b2a1ddfffc0c9d5fce4e391373cee5113b15caad] | committer: Rémi Denis-Courmont

display: clip zoom before waking thread

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

 src/video_output/display.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 3310b2d6f2..5caf504204 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -851,14 +851,6 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
             cfg.zoom.num = osys->zoom.num;
             cfg.zoom.den = osys->zoom.den;
 
-            if (10 * cfg.zoom.num <= cfg.zoom.den) {
-                cfg.zoom.num = 1;
-                cfg.zoom.den = 10;
-            } else if (cfg.zoom.num >= 10 * cfg.zoom.den) {
-                cfg.zoom.num = 10;
-                cfg.zoom.den = 1;
-            }
-
             vout_display_Control(vd, VOUT_DISPLAY_CHANGE_ZOOM, &cfg);
 
             osys->fit_window = -1;
@@ -1054,6 +1046,14 @@ void vout_SetDisplayZoom(vout_display_t *vd, unsigned num, unsigned den)
         den = 1;
     }
 
+    if (10 * num <= den) {
+        num = 1;
+        den = 10;
+    } else if (num >= 10 * den) {
+        num = 10;
+        den = 1;
+    }
+
     if (osys->is_display_filled ||
         osys->zoom.num != num || osys->zoom.den != den) {
         osys->ch_zoom = true;



More information about the vlc-commits mailing list