[vlc-commits] input: fix floating point comparison

Rémi Denis-Courmont git at videolan.org
Wed Aug 13 20:29:13 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 13 21:02:24 2014 +0300| [0b2b33f83fa6e06522ea3af30c821adaa2acb02c] | committer: Rémi Denis-Courmont

input: fix floating point comparison

The value is later used as single precision, so the comparison has to
have single precision too.

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

 src/input/input.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 4e48a1d..1b080e3 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -956,15 +956,13 @@ static void LoadSubtitles( input_thread_t *p_input )
 {
     /* Load subtitles */
     /* Get fps and set it if not already set */
-    const double f_fps = p_input->p->f_fps;
-    if( f_fps > 1.0 )
+    const float f_fps = p_input->p->f_fps;
+    if( f_fps > 1.f )
     {
-        float f_requested_fps;
-
         var_Create( p_input, "sub-original-fps", VLC_VAR_FLOAT );
         var_SetFloat( p_input, "sub-original-fps", f_fps );
 
-        f_requested_fps = var_CreateGetFloat( p_input, "sub-fps" );
+        float f_requested_fps = var_CreateGetFloat( p_input, "sub-fps" );
         if( f_requested_fps != f_fps )
         {
             var_Create( p_input, "sub-fps", VLC_VAR_FLOAT|



More information about the vlc-commits mailing list