[vlc-devel] [PATCH 14/15] core: replace hardcoded CLOCK_FREQ fractions by VTICK_FROM_MILLI()
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jun 15 17:09:25 CEST 2018
---
src/input/demux_chained.c | 2 +-
src/test/timer.c | 8 ++++----
src/video_output/video_output.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/input/demux_chained.c b/src/input/demux_chained.c
index f91adf164b1..d0a3d9c6298 100644
--- a/src/input/demux_chained.c
+++ b/src/input/demux_chained.c
@@ -87,7 +87,7 @@ static void *vlc_demux_chained_Thread(void *data)
dc->stats.time = newtime;
vlc_mutex_unlock(&dc->lock);
- next_update = mdate() + (CLOCK_FREQ / 4);
+ next_update = mdate() + VTICK_FROM_MILLI(250);
}
while (demux_Demux(demux) > 0);
diff --git a/src/test/timer.c b/src/test/timer.c
index fa0a4fda152..f1a41c0b44c 100644
--- a/src/test/timer.c
+++ b/src/test/timer.c
@@ -75,7 +75,7 @@ int main (void)
/* Relative timer */
ts = mdate ();
- vlc_timer_schedule (data.timer, false, 1, CLOCK_FREQ / 100);
+ vlc_timer_schedule (data.timer, false, 1, VTICK_FROM_MILLI(10));
vlc_mutex_lock (&data.lock);
while (data.count <= 10)
@@ -85,15 +85,15 @@ int main (void)
printf ("%u iterations in %"PRId64" us\n", data.count, ts);
data.count = 0;
vlc_mutex_unlock (&data.lock);
- assert(ts >= (CLOCK_FREQ / 10));
+ assert(ts >= VTICK_FROM_MILLI(100));
vlc_timer_schedule (data.timer, false, 0, 0);
/* Absolute timer */
ts = mdate ();
- vlc_timer_schedule (data.timer, true, ts + CLOCK_FREQ / 10,
- CLOCK_FREQ / 100);
+ vlc_timer_schedule (data.timer, true, ts + VTICK_FROM_MILLI(100),
+ VTICK_FROM_MILLI(10));
vlc_mutex_lock (&data.lock);
while (data.count <= 10)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 8de1b6fcf36..9f70bc94438 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1780,7 +1780,7 @@ static void *Thread(void *object)
if (wait)
{
- const mtime_t max_deadline = mdate() + CLOCK_FREQ/10;
+ const mtime_t max_deadline = mdate() + VTICK_FROM_MILLI(100);
deadline = deadline == VLC_TS_INVALID ? max_deadline : __MIN(deadline, max_deadline);
} else {
deadline = VLC_TS_INVALID;
--
2.17.0
More information about the vlc-devel
mailing list