impl-node: delay start when both a driver and driving

WE can only delay the start for drivers that are driving. Remote
nodes are driving themselves but are not drivers so they need to
start early.

See #879
This commit is contained in:
Wim Taymans 2021-03-16 17:28:40 +01:00
parent f2b537bb65
commit 6c94dc30a2

View file

@ -214,7 +214,7 @@ static int start_node(struct pw_impl_node *this)
pw_log_debug(NAME" %p: start node", this); pw_log_debug(NAME" %p: start node", this);
if (!this->driving) if (!(this->driving && this->driver))
res = spa_node_send_command(this->node, res = spa_node_send_command(this->node,
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start)); &SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start));
@ -339,7 +339,7 @@ static void node_update_state(struct pw_impl_node *node, enum pw_node_state stat
switch (state) { switch (state) {
case PW_NODE_STATE_RUNNING: case PW_NODE_STATE_RUNNING:
pw_loop_invoke(node->data_loop, do_node_add, 1, NULL, 0, true, node); pw_loop_invoke(node->data_loop, do_node_add, 1, NULL, 0, true, node);
if (node->driving) if (node->driving && node->driver)
spa_node_send_command(node->node, spa_node_send_command(node->node,
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start)); &SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start));
break; break;