[vlc-commits] modules: transform milliseconds value into vlc_tick_t with VLC_TICK_FROM_MS

Steve Lhomme git at videolan.org
Fri Jul 6 16:07:42 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun  6 12:25:08 2018 +0200| [11d1fc266fa859788f5e4f7000a13114e6353b76] | committer: Steve Lhomme

modules: transform milliseconds value into vlc_tick_t with VLC_TICK_FROM_MS

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

 modules/demux/gme.c                 | 2 +-
 modules/gui/qt/dialogs/gototime.cpp | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/demux/gme.c b/modules/demux/gme.c
index 1b5bb22cb7..b3c4ab20a4 100644
--- a/modules/demux/gme.c
+++ b/modules/demux/gme.c
@@ -150,7 +150,7 @@ static int Open (vlc_object_t *obj)
              continue;
          msg_Dbg (obj, "track %u: %s %d ms", i, infos->song, infos->length);
          if (infos->length != -1)
-             title->i_length = infos->length * INT64_C(1000);
+             title->i_length = VLC_TICK_FROM_MS(infos->length);
          if (infos->song[0])
              title->psz_name = strdup (infos->song);
          gme_free_info (infos);
diff --git a/modules/gui/qt/dialogs/gototime.cpp b/modules/gui/qt/dialogs/gototime.cpp
index 3da01cc412..1a96c83afd 100644
--- a/modules/gui/qt/dialogs/gototime.cpp
+++ b/modules/gui/qt/dialogs/gototime.cpp
@@ -106,9 +106,8 @@ void GotoTimeDialog::close()
 {
     if ( THEMIM->getIM()->hasInput() )
     {
-        int64_t i_time = (int64_t)
-            ( QTime( 0, 0, 0 ).msecsTo( timeEdit->time() ) ) * 1000;
-        var_SetInteger( THEMIM->getInput(), "time", i_time );
+        int i_time = QTime( 0, 0, 0 ).msecsTo( timeEdit->time() );
+        var_SetInteger( THEMIM->getInput(), "time", VLC_TICK_FROM_MS(i_time) );
     }
     toggleVisible();
 }



More information about the vlc-commits mailing list