mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
impl-node: fix reposition handling
We only need to sync clients when start/stop has been issued otherwise we simply write the new position values in the driver segment. Don't overwrite bar/video position info with invalid values.
This commit is contained in:
parent
a4d744e3cf
commit
f37b9ad67b
1 changed files with 12 additions and 6 deletions
|
|
@ -1246,10 +1246,6 @@ static int check_updates(struct pw_impl_node *node, uint32_t *reposition_owner)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*reposition_owner)
|
|
||||||
res = SYNC_START;
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1261,9 +1257,19 @@ static void do_reposition(struct pw_impl_node *driver, struct pw_impl_node *node
|
||||||
src = &node->rt.activation->reposition;
|
src = &node->rt.activation->reposition;
|
||||||
dst = &a->position.segments[0];
|
dst = &a->position.segments[0];
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: update position:%lu", node, src->position);
|
pw_log_trace(NAME" %p: update position:%lu", node, src->position);
|
||||||
|
|
||||||
|
dst->version = src->version;
|
||||||
|
dst->flags = src->flags;
|
||||||
|
dst->start = src->start;
|
||||||
|
dst->duration = src->duration;
|
||||||
|
dst->rate = src->rate;
|
||||||
|
dst->position = src->position;
|
||||||
|
if (src->bar.flags & SPA_IO_SEGMENT_BAR_FLAG_VALID)
|
||||||
|
dst->bar = src->bar;
|
||||||
|
if (src->video.flags & SPA_IO_SEGMENT_VIDEO_FLAG_VALID)
|
||||||
|
dst->video = src->video;
|
||||||
|
|
||||||
memcpy(dst, src, sizeof(struct spa_io_segment));
|
|
||||||
if (dst->start == 0)
|
if (dst->start == 0)
|
||||||
dst->start = a->position.clock.position - a->position.offset;
|
dst->start = a->position.clock.position - a->position.offset;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue