From 8e35a2f949f1fa41bce68ca7e9386c5413e0a4c9 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 30 Jan 2020 09:47:51 +1000 Subject: [PATCH] tools: refuse to replay recordings with timestamps from the future This indicates a bug in libinput record, might as well complain about it. Signed-off-by: Peter Hutterer --- tools/libinput-replay | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/libinput-replay b/tools/libinput-replay index ead331ea..0f385205 100755 --- a/tools/libinput-replay +++ b/tools/libinput-replay @@ -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: