[vlc-commits] vout: clamp zoom before dispatching the event

Rémi Denis-Courmont git at videolan.org
Sun Sep 2 17:19:11 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Sep  2 17:39:48 2018 +0300| [e423899f19897c7bbb3c78db82166917f77a4d44] | committer: Rémi Denis-Courmont

vout: clamp zoom before dispatching the event

...rather than after. This makes no functional differences.

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

 src/video_output/video_output.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 56281a815d..516816c016 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -569,6 +569,13 @@ void vout_ControlChangeDisplayFilled(vout_thread_t *vout, bool is_filled)
 
 void vout_ControlChangeZoom(vout_thread_t *vout, int num, int den)
 {
+    if (num * 10 < den) {
+        num = den;
+        den *= 10;
+    } else if (num > den * 10) {
+        num = den * 10;
+    }
+
     vout_ControlUpdateWindowSize(vout);
     vout_control_PushPair(&vout->p->control, VOUT_CONTROL_ZOOM,
                           num, den);
@@ -1426,13 +1433,6 @@ static void ThreadChangeDisplayFilled(vout_thread_t *vout, bool is_filled)
 
 static void ThreadChangeZoom(vout_thread_t *vout, int num, int den)
 {
-    if (num * 10 < den) {
-        num = den;
-        den *= 10;
-    } else if (num > den * 10) {
-        num = den * 10;
-    }
-
     vout_SetDisplayZoom(vout->p->display.vd, num, den);
 }
 



More information about the vlc-commits mailing list