[vlc-commits] core: vout: clip viewpoint zoom to [-1.f, 1.f]

Thomas Guillem git at videolan.org
Thu Nov 17 09:48:26 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Nov 16 13:08:59 2016 +0100| [c26f59fbcff28c795e394998302017f6d0fd0b0d] | committer: Thomas Guillem

core: vout: clip viewpoint zoom to [-1.f, 1.f]

>From -100% to 100%, default is still 0%.

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

 include/vlc_vout.h | 2 +-
 src/input/input.c  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index fcf7ff4..7c17cc1 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -90,7 +90,7 @@ struct vlc_viewpoint_t {
     float pitch; /* pitch in degrees */
     float roll;  /* roll in degrees */
     float fov;   /* field of view in degrees */
-    float zoom;  /* zoom factor, default to 0 */
+    float zoom;  /* zoom factor, [-1.f, 1.f] range, default to 0.f */
 };
 
 static inline void vlc_viewpoint_init( vlc_viewpoint_t *p_vp )
diff --git a/src/input/input.c b/src/input/input.c
index 8fcb61e..b183f7d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1948,6 +1948,7 @@ static bool Control( input_thread_t *p_input,
             priv->viewpoint.pitch = fmodf( priv->viewpoint.pitch, 360.f );
             priv->viewpoint.roll = fmodf( priv->viewpoint.roll, 360.f );
             priv->viewpoint.fov = VLC_CLIP( priv->viewpoint.fov, 0.f, 180.f );
+            priv->viewpoint.zoom = VLC_CLIP( priv->viewpoint.zoom, -1.f, 1.f );
 
             vout_thread_t **pp_vout;
             size_t i_vout;



More information about the vlc-commits mailing list