[vlc-commits] [Git][videolan/vlc][master] input: use double for vlc_tick_t conversions

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Aug 30 15:54:56 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
42b767af by Francois Cartegnie at 2022-08-30T15:31:07+00:00
input: use double for vlc_tick_t conversions

1111 becomes 1111000064 due to imprecision

- - - - -


1 changed file:

- src/input/input.c


Changes:

=====================================
src/input/input.c
=====================================
@@ -869,14 +869,14 @@ static void StartTitle( input_thread_t * p_input )
         input_ControlPushHelper( p_input, INPUT_CONTROL_SET_SEEKPOINT, &val );
 
     /* Start/stop/run time */
-    priv->i_start = llroundf((float)CLOCK_FREQ
-                                     * var_GetFloat( p_input, "start-time" ));
-    priv->i_stop  = llroundf((float)CLOCK_FREQ
-                                     * var_GetFloat( p_input, "stop-time" ));
+    priv->i_start = llroundl(CLOCK_FREQ *
+                             (double) var_GetFloat( p_input, "start-time" ));
+    priv->i_stop  = llroundl(CLOCK_FREQ *
+                             (double) var_GetFloat( p_input, "stop-time" ));
     if( priv->i_stop <= 0 )
     {
-        priv->i_stop = llroundf((float)CLOCK_FREQ
-                                     * var_GetFloat( p_input, "run-time" ));
+        priv->i_stop = llroundl(CLOCK_FREQ *
+                                (double) var_GetFloat( p_input, "run-time" ));
         if( priv->i_stop < 0 )
         {
             msg_Warn( p_input, "invalid run-time ignored" );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/42b767af6eba5e920579610a785098c80d60992a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/42b767af6eba5e920579610a785098c80d60992a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list