[vlc-devel] [PATCH 0/6 v4] timestamp/tick cleaning

Steve Lhomme robux4 at ycbcr.xyz
Fri Jun 22 18:17:38 CEST 2018


This version is simplified from the previous ones. There are only macros except
for seconds because floating point and integer seconds need to be taken care of.

The conversion macros differ depending on the CLOCK_FREQ value, if it's a
multiple of the unit or if the unit is a multiple of CLOCK_FREQ then the
operations minimize the possible overflow by reducing the fraction in use.

When they are not multiple then the overflow may occur and give rounded values.
It may be possible to reduce the overflow by reducing the fraction before
doing the operation but it's probably not suitable for a macro. If we want
to support this case we may reintroduce functions.

Steve Lhomme (6):
  vlc_tick: add helper macros to convert seconds to/from vlc_tick_t
  vlc_tick: add helper macros to convert milliseconds to/from vlc_tick_t
  vlc_tick: add helper macros to convert microseconds to/from vlc_tick_t
  vlc_tick: add helper macros to convert nanoseconds to/from vlc_tick_t
  vlc_tick: add msftime_t to express 100ns time
  vlc_tick: add VLC_TICK_EPSILON to express the tiniest vlc_tick_t that
    can be used

 include/vlc_tick.h | 119 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 119 insertions(+)

-- 
2.17.0



More information about the vlc-devel mailing list