[FFmpeg-devel] [PATCH] lavd: Use av_gettime_relative()

Nicolas George george at nsup.org
Sun May 18 09:29:23 CEST 2014


Le tridi 23 floréal, an CCXXII, Olivier Langlois a écrit :
> Whenever av_gettime() is used to measure relative period of time,
> av_gettime_relative() is prefered as it guarantee monotonic time
> on supported platforms.
> 
> Since v4l2 is compiled only on Linux where av_gettime_relative()
> is monotonic, a small wrapper function av_gettime_monotonic() is used
> (should be inlined the compiler) to put emphasis on that fact.

Since you leave the #if logic present, the clock is really monotonic, there
is really no doubt about it (except if broken on purpose). But the
explanations do no harm.

At a later point, I intend to rework that code to make better use of your
new API (use av_gettime_is_monotonic() and drop the #if logic; possibly make
the code usable by other devices).

But for now this patch looks plenty good enough to me.

Thanks for your efforts.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140518/01290c86/attachment.asc>


More information about the ffmpeg-devel mailing list