client-stream: just stop feeding the graph in paused

Stop feeding the graph in paused instead of going to idle. We might
want to idle in the future when we can get the clock resume as well.
This commit is contained in:
Wim Taymans 2018-10-09 16:34:37 +02:00
parent 9dba8f3a36
commit 1edf2dd210
2 changed files with 14 additions and 6 deletions

View file

@ -73,6 +73,7 @@ struct impl {
struct node node;
bool started;
bool active;
struct spa_hook node_listener;
struct spa_hook client_node_listener;
@ -794,6 +795,9 @@ static int impl_node_process(struct spa_node *node)
struct pw_driver_quantum *q = impl->this.node->driver_node->rt.quantum;
int status, trigger;
if (!impl->active)
return SPA_STATUS_HAVE_BUFFER;
impl->range.min_size = impl->range.max_size = q->size * sizeof(float);
spa_log_trace(this->log, "%p: process %d", this, impl->range.max_size);
@ -1074,7 +1078,7 @@ static void client_node_active_changed(void *data, bool active)
struct impl *impl = data;
pw_log_debug("client-stream %p: active %d", &impl->this, active);
pw_node_set_active(impl->this.node, active);
impl->active = active;
}
static const struct pw_node_events client_node_events = {

View file

@ -498,12 +498,12 @@ do_move_nodes(struct spa_loop *loop,
struct impl *dst = *(struct impl **)data;
struct spa_graph_node *n, *t;
pw_log_trace("node %p: root %p driver:%p", this, &this->rt.root, &dst->driver_graph);
pw_log_trace("node %p: root %p driver:%p->%p", this,
&this->rt.root, &src->driver_graph, &dst->driver_graph);
if (this->rt.root.graph != NULL) {
if (this->rt.root.graph != NULL)
spa_graph_node_remove(&this->rt.root);
spa_graph_node_add(&dst->driver_graph, &this->rt.root);
}
if (&src->driver_graph == &dst->driver_graph)
return 0;
@ -1152,8 +1152,12 @@ int pw_node_set_active(struct pw_node *node, bool active)
if (node->enabled)
node_activate(node);
}
else
else {
node->active = true;
pw_node_set_state(node, PW_NODE_STATE_IDLE);
node->active = false;
}
}
return 0;
}