[vlc-devel] [PATCH 04/15] vlc_common: add helper function for explicit nanosecond to/from mtime_t conversion
Steve Lhomme
robux4 at ycbcr.xyz
Sat Jun 16 09:34:18 CEST 2018
I used milli instead of ms so it's not confused with msftime_t. And so
micro and nano seems like logical siblings.
On 2018-06-15 7:58 PM, Rémi Denis-Courmont wrote:
> I'd use ms, us and ns. Nano is just weird.
>
> Le 15 juin 2018 18:09:15 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a
> écrit :
>
> It will be handy if mtime_t has better precision than microseconds.
> ---
> include/vlc_common.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/include/vlc_common.h b/include/vlc_common.h
> index d4186883df6..3191d3ce4c8 100644
> --- a/include/vlc_common.h
> +++ b/include/vlc_common.h
> @@ -316,6 +316,15 @@ static inline int64_t milli_from_vtick(mtime_t mt)
> return mt / (CLOCK_FREQ / 1000);
> }
>
> +static inline mtime_t vtick_from_nano(int64_t nano)
> +{
> + return nano / (INT64_C(1000000000) / CLOCK_FREQ);
> +}
> +static inline int64_t nano_from_vtick(mtime_t tck)
> +{
> + return tck * INT64_C(1000000000) / CLOCK_FREQ;
> +}
> +
> /**
> * The vlc_fourcc_t type.
> *
>
>
> --
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180616/6bfb2d7d/attachment.html>
More information about the vlc-devel
mailing list