From 99faea3a7b5d377e393d4c1f3d9dff3ab8676979 Mon Sep 17 00:00:00 2001 From: Moritz Kassner Date: Thu, 24 Jul 2014 09:59:22 +0200 Subject: [PATCH] bugfix --- .../uvc_capture/linux_video/v4l2_capture/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pupil_src/shared_modules/uvc_capture/linux_video/v4l2_capture/__init__.py b/pupil_src/shared_modules/uvc_capture/linux_video/v4l2_capture/__init__.py index c28b46c820..de501b760e 100644 --- a/pupil_src/shared_modules/uvc_capture/linux_video/v4l2_capture/__init__.py +++ b/pupil_src/shared_modules/uvc_capture/linux_video/v4l2_capture/__init__.py @@ -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)