mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
impl-node: delay starting the driver node
Only start the driver node after we have added ourselves to the driver node or else we might start too soon, before there is anything to schedule and we cause driver underruns.
This commit is contained in:
parent
62def0399f
commit
78e9e5958e
1 changed files with 6 additions and 2 deletions
|
|
@ -214,8 +214,9 @@ static int start_node(struct pw_impl_node *this)
|
|||
|
||||
pw_log_debug(NAME" %p: start node", this);
|
||||
|
||||
res = spa_node_send_command(this->node,
|
||||
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start));
|
||||
if (!this->driving)
|
||||
res = spa_node_send_command(this->node,
|
||||
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start));
|
||||
|
||||
if (res < 0)
|
||||
pw_log_error("(%s-%u) start node error %d: %s", this->name, this->info.id,
|
||||
|
|
@ -338,6 +339,9 @@ static void node_update_state(struct pw_impl_node *node, enum pw_node_state stat
|
|||
switch (state) {
|
||||
case PW_NODE_STATE_RUNNING:
|
||||
pw_loop_invoke(node->data_loop, do_node_add, 1, NULL, 0, true, node);
|
||||
if (node->driving)
|
||||
spa_node_send_command(node->node,
|
||||
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Start));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue