[PATCH] time warp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Birgit & Andreas B?ttger wrote:
> Hi all,
> 
> I use the nice "set system time" feature of vdr.
> But sometimes vdr seems to read gabage time from DVB,

Isn't all that data protected by CRC32 checksums?
How could "garbage" get in there?

Maybe somebody should try to find out why that "garbage"
is produced in the first place...

> jumps through the time and miss out timers.
> To avoid souch time warping, I use the assumption,
> that garbage values never be the same twice:
> 
> eit.c, line 261 ff.
> ----------------------------------------------------------------------
> cTDT::cTDT(const u_char *Data)
> :SI::TDT(Data, false)
> {
>   CheckParse();
> 
>   time_t sattim = getTime();
>   time_t loctim = time(NULL);
> 
>   static int lastDiff = 0;
>   int diff = abs(sattim - loctim);
>   if (diff > 2) {
>      if (abs(diff - lastDiff) < 3) {
>         mutex.Lock();
>         isyslog("System Time = %s (%ld)\n",
>                 *TimeToString(loctim), loctim);
>         isyslog("Local Time  = %s (%ld)\n",
>                 *TimeToString(sattim), sattim);
>         if (stime(&sattim) < 0)
>            esyslog("ERROR while setting system time: %m");
>         mutex.Unlock();
>      } else {
>         isyslog("diff = %d, ignored to avoid time warp :)", diff);
>      }
>      lastDiff = diff;
>   }
> }
> ----------------------------------------------------------------------


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux