mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-29 13:14:14 -04:00
audioconvert: small cleanups
Move the sync code to before it is used. We don't need to clear the graph setup state anymore in force mode, we did that before we did the sync.
This commit is contained in:
parent
f174b4e688
commit
978e8c1a4b
1 changed files with 21 additions and 26 deletions
|
|
@ -1367,8 +1367,28 @@ static int ensure_tmp(struct impl *this)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int do_sync_filter_graph(struct spa_loop *loop, bool async, uint32_t seq,
|
||||
const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct impl *impl = user_data;
|
||||
struct filter_graph *g;
|
||||
|
||||
static void sync_filter_graph(struct impl *impl);
|
||||
impl->n_graph = 0;
|
||||
spa_list_for_each(g, &impl->active_graphs, link)
|
||||
if (g->setup && !g->removing)
|
||||
impl->filter_graph[impl->n_graph++] = g;
|
||||
|
||||
impl->recalc = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sync_filter_graph(struct impl *impl)
|
||||
{
|
||||
if (impl->data_loop)
|
||||
spa_loop_locked(impl->data_loop, do_sync_filter_graph, 0, NULL, 0, impl);
|
||||
else
|
||||
do_sync_filter_graph(NULL, false, 0, NULL, 0, impl);
|
||||
}
|
||||
|
||||
static int setup_filter_graphs(struct impl *impl, bool force)
|
||||
{
|
||||
|
|
@ -1401,8 +1421,6 @@ static int setup_filter_graphs(struct impl *impl, bool force)
|
|||
spa_list_for_each_safe(g, t, &impl->active_graphs, link) {
|
||||
if (g->removing)
|
||||
continue;
|
||||
if (force)
|
||||
g->setup = false;
|
||||
if ((res = setup_filter_graph(impl, g, channels, position)) < 0) {
|
||||
g->removing = true;
|
||||
spa_log_warn(impl->log, "failed to activate graph %d: %s", g->order,
|
||||
|
|
@ -1421,29 +1439,6 @@ static int setup_filter_graphs(struct impl *impl, bool force)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int do_sync_filter_graph(struct spa_loop *loop, bool async, uint32_t seq,
|
||||
const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct impl *impl = user_data;
|
||||
struct filter_graph *g;
|
||||
|
||||
impl->n_graph = 0;
|
||||
spa_list_for_each(g, &impl->active_graphs, link)
|
||||
if (g->setup && !g->removing)
|
||||
impl->filter_graph[impl->n_graph++] = g;
|
||||
|
||||
impl->recalc = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sync_filter_graph(struct impl *impl)
|
||||
{
|
||||
if (impl->data_loop)
|
||||
spa_loop_locked(impl->data_loop, do_sync_filter_graph, 0, NULL, 0, impl);
|
||||
else
|
||||
do_sync_filter_graph(NULL, false, 0, NULL, 0, impl);
|
||||
}
|
||||
|
||||
static void clean_filter_handles(struct impl *impl, bool force)
|
||||
{
|
||||
struct filter_graph *g, *t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue