[vlc-commits] modules: transform vlc_tick_t value to milliseconds with MS_FROM_VLC_TICK

Steve Lhomme git at videolan.org
Wed Sep 19 11:58:11 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May  7 16:57:45 2018 +0200| [edc5babc16c107477297ff9b6bc226fdccab8e28] | committer: Steve Lhomme

modules: transform vlc_tick_t value to milliseconds with MS_FROM_VLC_TICK

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

 modules/codec/cea708.c        | 2 +-
 modules/codec/cvdsub.c        | 4 ++--
 modules/codec/libass.c        | 4 ++--
 modules/control/oldrc.c       | 2 +-
 modules/video_output/vdummy.c | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
index 2ffd3018fc..3107c90aab 100644
--- a/modules/codec/cea708.c
+++ b/modules/codec/cea708.c
@@ -1128,7 +1128,7 @@ cea708_t * CEA708_Decoder_New( decoder_t *p_dec )
 
 static void CEA708_Output( cea708_t *p_cea708 )
 {
-    Debug(printf("@%ld ms\n", p_cea708->i_clock / 1000));
+    Debug(printf("@%ld ms\n", MS_FROM_VLC_TICK(p_cea708->i_clock)));
     subpicture_t *p_spu = CEA708_BuildSubtitle( p_cea708 );
     if( p_spu )
         decoder_QueueSub( p_cea708->p_dec, p_spu );
diff --git a/modules/codec/cvdsub.c b/modules/codec/cvdsub.c
index df4916d5a0..f27343e450 100644
--- a/modules/codec/cvdsub.c
+++ b/modules/codec/cvdsub.c
@@ -357,8 +357,8 @@ static void ParseMetaInfo( decoder_t *p_dec, block_t *p_spu  )
             p_sys->i_duration = FROM_SCALE_NZ( (p[1]<<16) + (p[2]<<8) + p[3] );
 
 #ifdef DEBUG_CVDSUB
-            msg_Dbg( p_dec, "subtitle display duration %lu secs",
-                     (long unsigned int)(p_sys->i_duration / 90000) );
+            msg_Dbg( p_dec, "subtitle display duration %lu ms",
+                     MS_FROM_VLC_TICK(p_sys->i_duration) );
 #endif
             break;
 
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 49072e6040..51bc832cbd 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -398,7 +398,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     if( p_sys->p_track )
     {
         ass_process_chunk( p_sys->p_track, p_spu_sys->p_subs_data, p_spu_sys->i_subs_len,
-                           p_block->i_pts / 1000, p_block->i_length / 1000 );
+                           MS_FROM_VLC_TICK( p_block->i_pts ), MS_FROM_VLC_TICK( p_block->i_length ) );
     }
     vlc_mutex_unlock( &p_sys->lock );
 
@@ -441,7 +441,7 @@ static int SubpictureValidate( subpicture_t *p_subpic,
     const vlc_tick_t i_stream_date = p_spusys->i_pts + (i_ts - p_subpic->i_start);
     int i_changed;
     ASS_Image *p_img = ass_render_frame( p_sys->p_renderer, p_sys->p_track,
-                                         i_stream_date/1000, &i_changed );
+                                         MS_FROM_VLC_TICK( i_stream_date ), &i_changed );
 
     if( !i_changed && !b_fmt_src && !b_fmt_dst &&
         (p_img != NULL) == (p_subpic->p_region != NULL) )
diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 7f4e435ab3..56bde3a38f 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1746,7 +1746,7 @@ static bool ReadWin32( intf_thread_t *p_intf, unsigned char *p_buffer, int *pi_s
 
     /* On Win32, select() only works on socket descriptors */
     while( WaitForSingleObjectEx( p_intf->p_sys->hConsoleIn,
-                                INTF_IDLE_SLEEP/1000, TRUE ) == WAIT_OBJECT_0 )
+                                MS_FROM_VLC_TICK(INTF_IDLE_SLEEP), TRUE ) == WAIT_OBJECT_0 )
     {
         // Prefer to fail early when there's not enough space to store a 4 bytes
         // UTF8 character. The function will be immediatly called again and we won't
diff --git a/modules/video_output/vdummy.c b/modules/video_output/vdummy.c
index 887740122a..1a13e35468 100644
--- a/modules/video_output/vdummy.c
+++ b/modules/video_output/vdummy.c
@@ -153,7 +153,7 @@ static void DisplayStat(vout_display_t *vd, picture_t *picture, subpicture_t *su
         vlc_tick_t date;
         memcpy(&date, p->p_pixels, sizeof(date));
         msg_Dbg(vd, "VOUT got %"PRIu64" ms offset",
-                (vlc_tick_now() - date) / 1000 );
+                MS_FROM_VLC_TICK(vlc_tick_now() - date));
     }
     picture_Release(picture);
 }



More information about the vlc-commits mailing list