From f5f1a435ccf39a42a0ccf4ca4ba0ba6d84721b95 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 24 May 2018 16:10:22 +0200 Subject: [PATCH] client-node: improve time and position reporting --- src/modules/module-client-node/client-node.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 2918344ab..c5d94dd01 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -152,6 +152,7 @@ struct impl { int other_fds[2]; struct pw_client_node_position *position; + uint32_t next_position; }; /** \endcond */ @@ -905,8 +906,11 @@ static int impl_node_process(struct spa_node *node) q = impl->this.node->driver_node->rt.quantum; + impl->position->nsec = q->time; impl->position->duration = q->size; + impl->position->position = impl->next_position; impl->position->rate = q->rate; + impl->next_position += q->size; if (write(this->writefd, &cmd, 8) != 8) spa_log_warn(this->log, "node %p: error %s", this, strerror(errno));