Skip to content
Snippets Groups Projects
Commit af03afe3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

vlc_ticks: Simplify C++ integer variants of vlc_tick_from_sec

parent 381304e2
No related branches found
No related tags found
No related merge requests found
......@@ -53,18 +53,15 @@ typedef vlc_tick_t mtime_t; /* deprecated, use vlc_tick_t */
#define SEC_FROM_VLC_TICK(vtk) ((vtk) / CLOCK_FREQ)
#ifdef __cplusplus
static inline vlc_tick_t vlc_tick_from_sec(int64_t sec)
{
return CLOCK_FREQ * sec;
}
static inline vlc_tick_t vlc_tick_from_sec(int sec)
{
return CLOCK_FREQ * sec;
}
static inline vlc_tick_t vlc_tick_from_sec(uint32_t sec)
#include <type_traits>
template <typename T>
static inline auto vlc_tick_from_sec(T sec)
-> typename std::enable_if<std::is_integral<T>::value, vlc_tick_t>::type
{
return CLOCK_FREQ * sec;
}
/* seconds in floating point */
static inline vlc_tick_t vlc_tick_from_sec(double secf)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment