mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-11 02:50:24 +01:00
tools: record: fix broken event time stamp recording
event->time ended up being an uninitialized field. Introduced in 5dc1a7e, the
event here isn't a struct input event but rather our internal event struct.
Fix this and reshuffle the time handling a bit so it's a bit more obvious
here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
fb1f0a6886
commit
da9eace8db
1 changed files with 5 additions and 4 deletions
|
|
@ -279,18 +279,19 @@ handle_evdev_frame(struct record_context *ctx, struct record_device *d)
|
|||
while (libevdev_next_event(evdev,
|
||||
LIBEVDEV_READ_FLAG_NORMAL,
|
||||
&e) == LIBEVDEV_READ_STATUS_SUCCESS) {
|
||||
uint64_t time;
|
||||
uint64_t time = input_event_time(&e);
|
||||
|
||||
if (ctx->offset == 0)
|
||||
ctx->offset = input_event_time(&e);
|
||||
ctx->offset = time;
|
||||
else
|
||||
time = time_offset(ctx, time);
|
||||
|
||||
if (d->nevents == d->events_sz)
|
||||
resize(d->events, d->events_sz);
|
||||
|
||||
event = &d->events[d->nevents++];
|
||||
event->type = EVDEV;
|
||||
time = input_event_time(&e);
|
||||
input_event_set_time(&e, time - ctx->offset);
|
||||
event->time = time;
|
||||
event->u.evdev = e;
|
||||
count++;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue