pulse-server: make separate index

Separate the id (the pipewire object id) from the index (what we send to
the client to identify the objects).
This commit is contained in:
Wim Taymans 2022-01-17 11:28:40 +01:00
parent 955e4287ab
commit 0904a35ba8
19 changed files with 235 additions and 210 deletions

View file

@ -58,18 +58,25 @@ struct pw_manager_object *select_object(struct pw_manager *m, struct selector *s
continue;
if (o->id == s->id)
return o;
if (o->index == s->index)
return o;
if (s->accumulate)
s->accumulate(s, o);
if (o->props && s->key != NULL && s->value != NULL &&
(str = pw_properties_get(o->props, s->key)) != NULL &&
spa_streq(str, s->value))
return o;
if (s->value != NULL && (uint32_t)atoi(s->value) == o->id)
if (s->value != NULL && (uint32_t)atoi(s->value) == o->index)
return o;
}
return s->best;
}
uint32_t id_to_index(struct pw_manager *m, uint32_t id)
{
return id;
}
bool collect_is_linked(struct pw_manager *m, uint32_t id, enum pw_direction direction)
{
struct pw_manager_object *o;