[vlc-commits] opengl: make the check of fov consistent

Zhao Zhili git at videolan.org
Fri Apr 27 09:29:13 CEST 2018


vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Thu Apr 26 11:08:26 2018 +0800| [c38731410c97046a27fc269db4353f6552b0fc43] | committer: Thomas Guillem

opengl: make the check of fov consistent

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/video_output/opengl/vout_helper.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index bf459a1070..f4a8e4f0d7 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -1053,11 +1053,12 @@ static void UpdateFOVy(vout_display_opengl_t *vgl)
 int vout_display_opengl_SetViewpoint(vout_display_opengl_t *vgl,
                                      const vlc_viewpoint_t *p_vp)
 {
+    if (p_vp->fov > FIELD_OF_VIEW_DEGREES_MAX
+            || p_vp->fov < FIELD_OF_VIEW_DEGREES_MIN)
+        return VLC_EBADVAR;
+
 #define RAD(d) ((float) ((d) * M_PI / 180.f))
     float f_fovx = RAD(p_vp->fov);
-    if (f_fovx > FIELD_OF_VIEW_DEGREES_MAX * M_PI / 180 + 0.001f
-        || f_fovx < -0.001f)
-        return VLC_EBADVAR;
 
     vgl->f_teta = RAD(p_vp->yaw) - (float) M_PI_2;
     vgl->f_phi  = RAD(p_vp->pitch);



More information about the vlc-commits mailing list