[vlc-commits] demux:webvtt: clean the DEMUX_SET_POSITION value using vlc_tick_t

Steve Lhomme git at videolan.org
Thu Sep 20 12:43:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Sep 20 11:15:45 2018 +0200| [a296a4814a4f8ec01da3bf94c3568828976bfcf4] | committer: Steve Lhomme

demux:webvtt: clean the DEMUX_SET_POSITION value using vlc_tick_t

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

 modules/demux/webvtt.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/demux/webvtt.c b/modules/demux/webvtt.c
index a4d3639842..23c5e36d66 100644
--- a/modules/demux/webvtt.c
+++ b/modules/demux/webvtt.c
@@ -421,8 +421,7 @@ static void MakeExtradata( demux_sys_t *p_sys, void **p_extra, size_t *pi_extra
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    int64_t i64;
-    double *pf, f;
+    double *pf;
 
     switch( i_query )
     {
@@ -464,11 +463,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_SET_POSITION:
-            f = va_arg( args, double );
             if( p_sys->cues.i_count )
             {
-                i64 = f * p_sys->i_length;
-                p_sys->index.i_current = getIndexByTime( p_sys, i64 );
+                double f = va_arg( args, double );
+                p_sys->index.i_current = getIndexByTime( p_sys, p_sys->i_length * f );
                 p_sys->b_first_time = true;
                 p_sys->i_next_demux_time =
                         p_sys->index.p_array[p_sys->index.i_current].time;



More information about the vlc-commits mailing list