mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
context: fix sorted insert
This commit is contained in:
parent
34775b7577
commit
813e2d22a6
1 changed files with 8 additions and 3 deletions
|
|
@ -1104,14 +1104,19 @@ static int set_mask(pa_context *c, struct global *g)
|
|||
|
||||
static inline void insert_global(pa_context *c, struct global *global)
|
||||
{
|
||||
struct global *g, *t;
|
||||
struct global *g;
|
||||
bool found = false;
|
||||
|
||||
spa_list_for_each_safe(g, t, &c->globals, link) {
|
||||
spa_list_for_each(g, &c->globals, link) {
|
||||
if (g->priority_master < global->priority_master) {
|
||||
g = spa_list_prev(g, link);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
spa_list_append(&g->link, &global->link);
|
||||
else
|
||||
spa_list_prepend(&g->link, &global->link);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue