[vlc-commits] demux: subtitle: use an integer for the mpsub factor

Steve Lhomme git at videolan.org
Wed Sep 19 15:46:18 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jun  1 17:13:12 2018 +0200| [7572803a07fdd5ccfc5afb7e6ada724cb4277883] | committer: Steve Lhomme

demux: subtitle: use an integer for the mpsub factor

it's never a floating value

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

 modules/demux/subtitle.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 5490b2a8fc..8e6e48db35 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -156,7 +156,7 @@ typedef struct
         bool  b_inited;
 
         float f_total;
-        float f_factor;
+        int i_factor;
     } mpsub;
 
     struct
@@ -1692,7 +1692,7 @@ static int ParseMPSub( vlc_object_t *p_obj, subs_properties_t *p_props,
     if( !p_props->mpsub.b_inited )
     {
         p_props->mpsub.f_total = 0.0;
-        p_props->mpsub.f_factor = 0.0;
+        p_props->mpsub.i_factor = 0;
 
         p_props->mpsub.b_inited = true;
     }
@@ -1713,7 +1713,7 @@ static int ParseMPSub( vlc_object_t *p_obj, subs_properties_t *p_props,
         {
             if( sscanf (s, "FORMAT=TIM%c", &p_dummy ) == 1 && p_dummy == 'E')
             {
-                p_props->mpsub.f_factor = 100.0;
+                p_props->mpsub.i_factor = 100;
                 break;
             }
 
@@ -1731,7 +1731,7 @@ static int ParseMPSub( vlc_object_t *p_obj, subs_properties_t *p_props,
                 if( f_fps > 0.f && var_GetFloat( p_obj, "sub-fps" ) <= 0.f )
                     var_SetFloat( p_obj, "sub-fps", f_fps );
 
-                p_props->mpsub.f_factor = 1.f;
+                p_props->mpsub.i_factor = 1;
                 free( psz_temp );
                 break;
             }
@@ -1743,9 +1743,9 @@ static int ParseMPSub( vlc_object_t *p_obj, subs_properties_t *p_props,
         if( *psz_temp )
         {
             float f2 = us_strtof( psz_temp, NULL );
-            p_props->mpsub.f_total += f1 * p_props->mpsub.f_factor;
+            p_props->mpsub.f_total += f1 * p_props->mpsub.i_factor;
             p_subtitle->i_start = llroundf(10000.f * p_props->mpsub.f_total);
-            p_props->mpsub.f_total += f2 * p_props->mpsub.f_factor;
+            p_props->mpsub.f_total += f2 * p_props->mpsub.i_factor;
             p_subtitle->i_stop = llroundf(10000.f * p_props->mpsub.f_total);
             break;
         }



More information about the vlc-commits mailing list