From e287087d3b057707212231a07367bc4b8c9bf5a7 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 16 Mar 2023 17:02:45 +0100 Subject: [PATCH] Use delta per stream in ovnidump --- src/emu/ovnidump.c | 2 +- src/emu/stream.c | 1 + src/emu/stream.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emu/ovnidump.c b/src/emu/ovnidump.c index 10a36dc..5eb1155 100644 --- a/src/emu/ovnidump.c +++ b/src/emu/ovnidump.c @@ -23,7 +23,7 @@ emit(struct player *player) struct stream *stream = player_stream(player); /* Use raw clock in the ovni event */ - int64_t rel = ev->rclock - c; + int64_t rel = stream->deltaclock; c = ev->rclock; printf("%s %10ld %+10ld %c%c%c", diff --git a/src/emu/stream.c b/src/emu/stream.c index 76715b6..7e8a422 100644 --- a/src/emu/stream.c +++ b/src/emu/stream.c @@ -232,6 +232,7 @@ stream_step(struct stream *stream) } } + stream->deltaclock = clock - stream->lastclock; stream->lastclock = clock; return 0; diff --git a/src/emu/stream.h b/src/emu/stream.h index 93463da..2bbfd13 100644 --- a/src/emu/stream.h +++ b/src/emu/stream.h @@ -15,6 +15,7 @@ struct stream { uint8_t *buf; int64_t size; int64_t lastclock; + int64_t deltaclock; int64_t clock_offset; heap_node_t hh;