mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
filtet-chain: instatiate only once
This commit is contained in:
parent
b160a72018
commit
e03c3311eb
1 changed files with 11 additions and 0 deletions
|
|
@ -627,6 +627,8 @@ struct graph {
|
||||||
|
|
||||||
uint32_t n_control;
|
uint32_t n_control;
|
||||||
struct port **control_port;
|
struct port **control_port;
|
||||||
|
|
||||||
|
unsigned instantiated:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct impl {
|
struct impl {
|
||||||
|
|
@ -1777,6 +1779,7 @@ static void node_cleanup(struct node *node)
|
||||||
for (i = 0; i < node->n_hndl; i++) {
|
for (i = 0; i < node->n_hndl; i++) {
|
||||||
if (node->hndl[i] == NULL)
|
if (node->hndl[i] == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
pw_log_info("cleanup %s %d", d->name, i);
|
||||||
if (d->deactivate)
|
if (d->deactivate)
|
||||||
d->deactivate(node->hndl[i]);
|
d->deactivate(node->hndl[i]);
|
||||||
d->cleanup(node->hndl[i]);
|
d->cleanup(node->hndl[i]);
|
||||||
|
|
@ -1826,6 +1829,9 @@ static void node_free(struct node *node)
|
||||||
static void graph_cleanup(struct graph *graph)
|
static void graph_cleanup(struct graph *graph)
|
||||||
{
|
{
|
||||||
struct node *node;
|
struct node *node;
|
||||||
|
if (!graph->instantiated)
|
||||||
|
return;
|
||||||
|
graph->instantiated = false;
|
||||||
spa_list_for_each(node, &graph->node_list, link)
|
spa_list_for_each(node, &graph->node_list, link)
|
||||||
node_cleanup(node);
|
node_cleanup(node);
|
||||||
}
|
}
|
||||||
|
|
@ -1841,6 +1847,11 @@ static int graph_instantiate(struct graph *graph)
|
||||||
uint32_t i, j;
|
uint32_t i, j;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
if (graph->instantiated)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
graph->instantiated = true;
|
||||||
|
|
||||||
spa_list_for_each(node, &graph->node_list, link) {
|
spa_list_for_each(node, &graph->node_list, link) {
|
||||||
float *sd = silence_data, *dd = discard_data;
|
float *sd = silence_data, *dd = discard_data;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue