[FFmpeg-devel] [PATCH] Use monotonic clock for measuring reltime.

LANGLOIS Olivier PIS -EXT olivier.pis.langlois at transport.alstom.com
Wed Apr 2 20:05:01 CEST 2014


> -----Original Message-----
> From: ffmpeg-devel-bounces at ffmpeg.org [mailto:ffmpeg-devel-
> bounces at ffmpeg.org] On Behalf Of Nicolas George
> Sent: Wednesday, April 02, 2014 12:15 PM
> To: FFmpeg development discussions and patches
> Subject: Re: [FFmpeg-devel] [PATCH] Use monotonic clock for measuring
> reltime.
>
> Le tridi 13 germinal, an CCXXII, Don Moir a écrit :
> > The wall time can change by a second or seconds forward or backward
> > depending on automated clock updates and user setting.
>
> They are bogus settings. Modern operating systems can smooth the
> correction over a period of time to update the clock by a small amount.

from man ntpdate:

       Time adjustments are made by ntpdate in one of two ways. If ntpdate  determines
       the  clock  is  in  error  more than 0.5 second it will simply step the time by
       calling the system settimeofday() routine. If the error is less than  0.5  secâ
       onds, it will slew the time by calling the system adjtime() routine. The latter
       technique is less disruptive and more accurate when the  error  is  small,  and
       works quite well when ntpdate is run by cron every hour or two.

settimeofday() or clock_settime() cause jumps, adjtime() will slow down or speed it up to correct the clock.
>
> > Can change during daylight savings time switch over by an hour as well.
>
> Wrong.

It depends. You have the option to store the system time in the RTC (hardware clock) either as UTC or local time in Linux. Setting RTC time in local time isn't advised but may be required if dual booting with Windows. When having DST change, you either let the other OS  correct the RTC time or you can manually fix it.

I have 0 Windows installation around me so I am not sure but I would not totally rule out that manual DST management can have  effect on system time.

inspect /etc/adjtime content to find out how your RTC is configured or see

http://tldp.org/HOWTO/Clock-2.html

for more info on the topic.

Please ignore the confidentiality notice below.
It is automatically added without my consent.


________________________________
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.


More information about the ffmpeg-devel mailing list