[vlc-commits] modules:playlist: convert vlc_tick_t to seconds using SEC_FROM_VLC_TICK()

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jun 12 12:05:26 2018 +0200| [6e5b06b18d0e01ca4f168d9ed198f5d60c82c403] | committer: Steve Lhomme

modules:playlist: convert vlc_tick_t to seconds using SEC_FROM_VLC_TICK()

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

 modules/misc/playlist/html.c | 4 ++--
 modules/misc/playlist/m3u.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/misc/playlist/html.c b/modules/misc/playlist/html.c
index dd25656abd..069fbc6190 100644
--- a/modules/misc/playlist/html.c
+++ b/modules/misc/playlist/html.c
@@ -71,8 +71,8 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root )
             free( psz_tmp );
 
             vlc_tick_t i_duration = input_item_GetDuration( p_current->p_input );
-            int min = ( i_duration / CLOCK_FREQ ) / 60;
-            int sec = ( i_duration / CLOCK_FREQ ) - min * 60;
+            int min = SEC_FROM_VLC_TICK( i_duration ) / 60;
+            int sec = SEC_FROM_VLC_TICK( i_duration ) - min * 60;
 
             // Print the artist if we have one
             if( psz_artist && *psz_artist )
diff --git a/modules/misc/playlist/m3u.c b/modules/misc/playlist/m3u.c
index f74045c81e..ab50f80dd1 100644
--- a/modules/misc/playlist/m3u.c
+++ b/modules/misc/playlist/m3u.c
@@ -89,13 +89,13 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root,
             {
                 /* write EXTINF with artist */
                 pf_fprintf( p_export->p_file, "#EXTINF:%"PRIu64",%s - %s\n",
-                            i_duration / CLOCK_FREQ, psz_artist, psz_name);
+                            SEC_FROM_VLC_TICK(i_duration), psz_artist, psz_name);
             }
             else
             {
                 /* write EXTINF without artist */
                 pf_fprintf( p_export->p_file, "#EXTINF:%"PRIu64",%s\n",
-                            i_duration / CLOCK_FREQ, psz_name);
+                            SEC_FROM_VLC_TICK(i_duration), psz_name);
             }
             free( psz_artist );
         }



More information about the vlc-commits mailing list