aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/utils/contexts/TobiiProGlasses2.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/argaze/utils/contexts/TobiiProGlasses2.py b/src/argaze/utils/contexts/TobiiProGlasses2.py
index 75cd0ff..fbc9d1e 100644
--- a/src/argaze/utils/contexts/TobiiProGlasses2.py
+++ b/src/argaze/utils/contexts/TobiiProGlasses2.py
@@ -1362,20 +1362,17 @@ class SegmentPlayback(ArFeatures.DataPlaybackContext):
logging.info('Difference between data and sync event timestamps is %i ms', diff_data_ts-diff_sync_ts)
- # Don't process gaze positions if sync is required but no image have been processed yet
- if self.__sync_event is not None and self.__sync_video_ts is None:
+ # Don't process gaze positions when:
+ # - no image have been processed yet
+ # - no sync event happened yet
+ if self.__sync_video_ts is None or self.__sync_ts is None:
- continue
+ continue
- # Don't process gaze positions if sync is required but sync event not happened yet
- elif self.__sync_event is not None and self.__sync_ts is None:
+ # Otherwise, synchronize timestamp with sync event
+ else:
- continue
-
- # Otherwise, synchronize timestamp with sync event
- elif self.__sync_event is not None and self.__sync_ts is not None:
-
- data_ts = int(self.__sync_ts + data_ts - self.__sync_data_ts)
+ data_ts = int(self.__sync_ts + data_ts - self.__sync_data_ts)
# Process gaze positions
match data_object_type: