From de5a8a689915bc5918097168a172e11ad1059c3f Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 19 Aug 2023 09:28:05 -0700 Subject: til_stream: track frame in til_stream_pipe_t This is needed for determining which tap's first on a given pipe per-frame. --- src/til_stream.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/til_stream.c b/src/til_stream.c index c508e35..eec0af4 100644 --- a/src/til_stream.c +++ b/src/til_stream.c @@ -78,6 +78,7 @@ struct til_stream_pipe_t { const void *owner_foo; /* supplemental pointer for owner's use */ char *parent_path; const til_tap_t *driving_tap; /* tap producing values for the pipe */ + unsigned frame; /* most recent frame tapped */ uint32_t hash; /* hash of (driving_tap->name_hash ^ .parent_hash) */ }; @@ -239,6 +240,7 @@ int til_stream_tap(til_stream_t *stream, const void *owner, const void *owner_fo if (pipe->driving_tap == tap) { /* this is the pipe and we're driving */ *(tap->ptr) = pipe->driving_tap->elems; + pipe->frame = stream->frame; pthread_mutex_unlock(&stream->mutex); return 0; @@ -257,6 +259,7 @@ int til_stream_tap(til_stream_t *stream, const void *owner, const void *owner_fo pipe->driving_tap = tap; *(tap->ptr) = pipe->driving_tap->elems; + pipe->frame = stream->frame; pthread_mutex_unlock(&stream->mutex); return (tap != pipe->driving_tap); @@ -282,6 +285,7 @@ int til_stream_tap(til_stream_t *stream, const void *owner, const void *owner_fo pipe->owner = *p_owner; pipe->owner_foo = *p_owner_foo; pipe->driving_tap = *p_tap; + pipe->frame = stream->frame; pipe->parent_path = strdup(parent_path); if (!pipe->parent_path) { -- cgit v1.2.1