Skip to content

Commit

Permalink
tools: refuse to replay recordings with timestamps from the future
Browse files Browse the repository at this point in the history
This indicates a bug in libinput record, might as well complain about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Jan 30, 2020
1 parent acfec31 commit 8e35a2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/libinput-replay
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def replay(device, verbose):
# offset is the offset from the first event on any device.
offset = time.time() - device['__first_event_offset']

if offset < 0:
error('WARNING: event time offset is in the future, refusing to replay')
return

# each 'evdev' set contains one SYN_REPORT so we only need to check for
# the time offset once per event
for event in events:
Expand Down

0 comments on commit 8e35a2f

Please sign in to comment.