impl-link: handle mixer failures better

It is possible that the mixer input can't be created because of hitting
the max limits of dsp mixer or client-node. Make sure we handle those
errors, destroy the link and clean up properly.
This commit is contained in:
Wim Taymans 2022-01-24 09:39:52 +01:00
parent a67f38f790
commit 7e387d842b
3 changed files with 38 additions and 25 deletions

View file

@ -219,6 +219,8 @@ static struct mix *find_mix(struct port *p, uint32_t mix_id)
if (mix_id >= len) {
size_t need = sizeof(struct mix) * (mix_id + 1 - len);
void *ptr = pw_array_add(&p->mix, need);
if (ptr == NULL)
return NULL;
memset(ptr, 0, need);
}
mix = pw_array_get_unchecked(&p->mix, mix_id, struct mix);