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

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


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

modules: use the vlc_tick_t/ms conversion macros for hardcoded values

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

 modules/access/dtv/en50221.c             | 2 +-
 modules/access/satip.c                   | 2 +-
 modules/access_output/udp.c              | 4 ++--
 modules/codec/dvbsub.c                   | 2 +-
 modules/codec/spudec/parse.c             | 2 +-
 modules/demux/mp4/heif.c                 | 2 +-
 modules/stream_out/transcode/transcode.h | 2 +-
 modules/visualization/goom.c             | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/access/dtv/en50221.c b/modules/access/dtv/en50221.c
index 03e98dc021..6126b5d7f2 100644
--- a/modules/access/dtv/en50221.c
+++ b/modules/access/dtv/en50221.c
@@ -1267,7 +1267,7 @@ static void CAPMTAdd( cam_t * p_cam, int i_session_id,
     }
  
 #ifdef CAPMT_WAIT
-    vlc_tick_sleep( CAPMT_WAIT * 1000 );
+    vlc_tick_sleep( VLC_TICK_FROM_MS(CAPMT_WAIT) );
 #endif
  
     msg_Dbg( p_cam->obj, "adding CAPMT for SID %d on session %d",
diff --git a/modules/access/satip.c b/modules/access/satip.c
index 778deb16e9..6dabeb4302 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -740,7 +740,7 @@ static int satip_open(vlc_object_t *obj)
 
     /* Extra sleep for compatibility with some satip servers, that
      * can't handle PLAY right after SETUP */
-    if (vlc_msleep_i11e(50000) < 0)
+    if (vlc_msleep_i11e(VLC_TICK_FROM_MS(50)) < 0)
         goto error;
 
     /* Open UDP socket for reading if not done */
diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index 80dc4f690f..feb413d0dd 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -379,7 +379,7 @@ static void* ThreadWrite( void *data )
                 i_dropped_packets++;
                 continue;
             }
-            else if( i_date - i_date_last < -1000 )
+            else if( i_date - i_date_last < VLC_TICK_FROM_MS(-1) )
             {
                 if( !i_dropped_packets )
                     msg_Dbg( p_access, "mmh, packets in the past (%"PRId64")",
@@ -406,7 +406,7 @@ static void* ThreadWrite( void *data )
 
 #if 1
         i_sent = vlc_tick_now();
-        if ( i_sent > i_date + 20000 )
+        if ( i_sent > i_date + VLC_TICK_FROM_MS(20) )
         {
             msg_Dbg( p_access, "packet has been sent too late (%"PRId64 ")",
                      i_sent - i_date );
diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c
index 0d38522e51..8231796b70 100644
--- a/modules/codec/dvbsub.c
+++ b/modules/codec/dvbsub.c
@@ -2046,7 +2046,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
         p_block_stop->i_buffer = bs_pos( s ) / 8;
         p_block_stop->i_pts = p_block_stop->i_dts = p_subpic->i_stop;
         block_ChainAppend( &p_block, p_block_stop );
-        p_block_stop->i_length = 100000; /* p_subpic->i_stop - p_subpic->i_start; */
+        p_block_stop->i_length = VLC_TICK_FROM_MS(100); /* p_subpic->i_stop - p_subpic->i_start; */
     }
 #ifdef DEBUG_DVBSUB
     msg_Dbg( p_enc, "subpicture encoded properly" );
diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c
index 4dfefdeb22..bf7a3c0973 100644
--- a/modules/codec/spudec/parse.c
+++ b/modules/codec/spudec/parse.c
@@ -425,7 +425,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
     if( p_spu->i_stop <= p_spu->i_start && !p_spu->b_ephemer )
     {
         /* This subtitle will live for 5 seconds or until the next subtitle */
-        p_spu->i_stop = p_spu->i_start + (vlc_tick_t)500 * 11000;
+        p_spu->i_stop = p_spu->i_start + VLC_TICK_FROM_MS(500 * 11);
         p_spu->b_ephemer = true;
     }
 
diff --git a/modules/demux/mp4/heif.c b/modules/demux/mp4/heif.c
index 4f7ef59fc8..a8c26e7ee6 100644
--- a/modules/demux/mp4/heif.c
+++ b/modules/demux/mp4/heif.c
@@ -223,7 +223,7 @@ static int DemuxHEIF( demux_t *p_demux )
         es_out_Control( p_demux->out, ES_OUT_GET_EMPTY, &b_empty );
         if( !b_empty || vlc_tick_now() <= p_sys->i_end_display_time )
         {
-            vlc_tick_sleep( 40 * 1000 );
+            vlc_tick_sleep( VLC_TICK_FROM_MS(40) );
             return VLC_DEMUXER_SUCCESS;
         }
         p_sys->i_end_display_time = 0;
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index ffb4f953ee..284b4c0970 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -3,7 +3,7 @@
 #include <vlc_codec.h>
 
 /*100ms is around the limit where people are noticing lipsync issues*/
-#define MASTER_SYNC_MAX_DRIFT 100000
+#define MASTER_SYNC_MAX_DRIFT VLC_TICK_FROM_MS(100)
 
 typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
 
diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index 59d247a778..039971be08 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -74,7 +74,7 @@ vlc_module_end ()
  * Local prototypes
  *****************************************************************************/
 #define MAX_BLOCKS 100
-#define GOOM_DELAY 400000
+#define GOOM_DELAY VLC_TICK_FROM_MS(400)
 
 typedef struct
 {



More information about the vlc-commits mailing list