node: move segment owner into the io area

This makes it easier to keep track of who is responsible for what.
Also remove the valid fields and move them to flags in the segment
info. That way, the owner can update the flags without having to
worry about concurrency.

Keep separate info for the reposition information. We need to do this
to make it possible to seek in other formats than the frame.

Clear out the owner field when the node is destroyed or removed from
the driver.
This commit is contained in:
Wim Taymans 2019-08-29 18:21:32 +02:00
parent a910deb0fc
commit 8afa5b0ada
5 changed files with 59 additions and 51 deletions

View file

@ -338,12 +338,11 @@ static void client_process(void *data)
p->n_segments = 1;
s = &p->segments[0];
s->flags = SPA_IO_SEGMENT_VALID_POSITION;
s->flags = 0;
s->position = jp->frame;
s->rate = 1.0;
s->valid = 0;
if (jp->valid & JackPositionBBT) {
s->valid |= SPA_IO_SEGMENT_VALID_BAR;
s->bar.flags = SPA_IO_SEGMENT_BAR_FLAG_VALID;
if (jp->valid & JackBBTFrameOffset)
s->bar.offset = jp->bbt_offset;
else