Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassner committed Jul 24, 2014
1 parent ad6e623 commit 99faea3
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,15 @@ def read(self,retry=3):
if self.use_hw_timestamps:
timestamp = buf.timestamp.secs+buf.timestamp.usecs/1000000.
# lets make sure this timestamps is sane:
if abs(timestamp-self.get_time_monotonic()) > 2: #hw_timestamp more than 2secs away from now?
if abs(timestamp-self.get_time_monotonic()) > 5: #hw_timestamp more than 5secs away from now?
logger.warning("Hardware timestamp from %s is reported to be %s but monotonic time is %s and last timestamp was %s"%(self.src_str,timestamp,self.get_time_monotonic(),self._last_timestamp))
logger.warning("Correcting timestamp by extrapolation from last known timestamp using set rate: %s"%self.get_rate())
timestamp = self._last_timestamp + 1./self.get_rate()
self._last_timestamp = timestamp

logger.warning("Correcting timestamp by extrapolation from last known timestamp using set rate: %s. TS now at %s"%(self.get_rate(),timestamp) )
self._last_timestamp = timestamp

else:
timestamp = self.get_time_monotonic()


timestamp -= self.timebase.value
# if ( self.ts > timestamp) or 1:
# print "%s %s" %(self.src_str, self.get_time_monotonic()-timestamp)
Expand Down

0 comments on commit 99faea3

Please sign in to comment.