[vlc-commits] ttml/webvtt: use the vlc_tick_t/ms conversion macros for hardcoded values

Steve Lhomme git at videolan.org
Tue Sep 18 17:07:30 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May  7 08:43:37 2018 +0200| [7670e047a621b8ce642dc41bfde99f8a00bf854d] | committer: Steve Lhomme

ttml/webvtt: use the vlc_tick_t/ms conversion macros for hardcoded values

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

 modules/demux/ttml.c   | 2 +-
 modules/demux/webvtt.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 67643918a9..cb654320d0 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -255,7 +255,7 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
             else if( p_sys->times.i_count > 0 )
             {
                 i64 = tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_count - 1] );
-                *pf = (double) p_sys->i_next_demux_time / (i64 + 0.5);
+                *pf = (double) p_sys->i_next_demux_time / (i64 + VLC_TICK_FROM_MS(500));
             }
             else
             {
diff --git a/modules/demux/webvtt.c b/modules/demux/webvtt.c
index 862f18b0dc..74c758c713 100644
--- a/modules/demux/webvtt.c
+++ b/modules/demux/webvtt.c
@@ -459,7 +459,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             else if( p_sys->index.i_count > 0 )
             {
                 *pf = (double) p_sys->i_next_demux_time /
-                      (p_sys->i_length + 0.5);
+                      (p_sys->i_length + VLC_TICK_FROM_MS(500));
             }
             else
             {



More information about the vlc-commits mailing list