[vlc-devel] [PATCH 02/10] vlc_tick: add helper macros to convert to/from seconds/vlc_tick_t explicitly
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jun 22 14:53:19 CEST 2018
---
include/vlc_tick.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/vlc_tick.h b/include/vlc_tick.h
index 351119802e0..246c7311b5c 100644
--- a/include/vlc_tick.h
+++ b/include/vlc_tick.h
@@ -48,6 +48,9 @@ typedef vlc_tick_t mtime_t; /* deprecated, use vlc_tick_t */
#define VLC_TICK_FROM_MS(ms) ((ms) * (CLOCK_FREQ / 1000))
#define MS_FROM_VLC_TICK(vtk) (((vtk) * 1000) / CLOCK_FREQ)
+#define VLC_TICK_FROM_SEC(sec) ((sec) * CLOCK_FREQ) /* seconds in vlc_tick_t */
+#define SEC_FROM_VLC_TICK(vtk) ((vtk) / CLOCK_FREQ) /* vlc_tick_t in seconds */
+
/*****************************************************************************
* MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
*****************************************************************************
--
2.17.0
More information about the vlc-devel
mailing list