[vlc-commits] libvlc: use MS_FROM_VLC_TICK() for values returned in milliseconds

Steve Lhomme git at videolan.org
Thu Jul 5 16:57:52 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 14 10:10:42 2018 +0200| [294e67b0521e7e08a1fed6053c9ef4e05e6c55f4] | committer: Steve Lhomme

libvlc: use MS_FROM_VLC_TICK() for values returned in milliseconds

But are not libvlc_time_t for some reason.

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

 lib/media_player.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/media_player.c b/lib/media_player.c
index 2755048162..e293e2cbb0 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1515,7 +1515,7 @@ int libvlc_media_player_get_full_title_descriptions( libvlc_media_player_t *p_mi
         titles[i] = title;
 
         /* we want to return milliseconds to match the rest of the API */
-        title->i_duration = p_input_title[i]->i_length / 1000;
+        title->i_duration = MS_FROM_VLC_TICK(p_input_title[i]->i_length);
         title->i_flags = p_input_title[i]->i_flags;
         if( p_input_title[i]->psz_name )
             title->psz_name = strdup( p_input_title[i]->psz_name );
@@ -1580,7 +1580,7 @@ int libvlc_media_player_get_full_chapter_descriptions( libvlc_media_player_t *p_
     {
         goto error;
     }
-    int64_t i_title_duration = p_title->i_length / 1000;
+    int64_t i_title_duration = MS_FROM_VLC_TICK(p_title->i_length);
     vlc_input_title_Delete( p_title );
 
     *pp_chapters = calloc( ci_chapter_count, sizeof(**pp_chapters) );



More information about the vlc-commits mailing list