[vlc-devel] [vlc-commits] vlc_tick: add vlc_tick_from_timeval()
Steve Lhomme
robux4 at ycbcr.xyz
Wed Jul 4 17:53:36 CEST 2018
On 2018-07-04 16:20, Rémi Denis-Courmont wrote:
> timeval is not an ISO type, unlike timespec. Expect problems and
> consider using a macro.
Ah yes, I forgot about macros. It's better than including headers for
various platforms.
>
> Le 4 juillet 2018 11:39:19 GMT+03:00, Steve Lhomme <git at videolan.org>
> a écrit :
>
> vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul 4 10:23:28 2018 +0200| [928e966451d7217cee2f216a001578cd3928180a] | committer: Steve Lhomme
>
> vlc_tick: add vlc_tick_from_timeval()
>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=928e966451d7217cee2f216a001578cd3928180a
>
>
> ---
>
> include/vlc_tick.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/vlc_tick.h b/include/vlc_tick.h
> index daa9a13633..6908126c7f 100644
> --- a/include/vlc_tick.h
> +++ b/include/vlc_tick.h
> @@ -154,6 +154,11 @@ typedef int64_t msftime_t;
> #define MSFTIME_FROM_VLC_TICK(vtk) ((vtk) * INT64_C(10000000) / CLOCK_FREQ)
> #endif /* CLOCK_FREQ / 10000000 */
>
> +static inline vlc_tick_t vlc_tick_from_timeval(const struct timeval *tv)
> +{
> + return vlc_tick_from_sec( tv->tv_sec ) + VLC_TICK_FROM_US( tv->tv_usec );
> +}
> +
>
> /*****************************************************************************
> * MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
>
> ------------------------------------------------------------------------
>
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
>
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
> excuser ma brièveté.
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list