audiomixer: rework event handling to avoid race conditions 56/23556/1 halibut 8.0.5 8.0.6 halibut/8.0.5 halibut/8.0.6 halibut_8.0.5 halibut_8.0.6
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 24 Dec 2019 09:36:06 +0000 (11:36 +0200)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 7 Jan 2020 14:48:19 +0000 (16:48 +0200)
commit9cb6cb6c27fd4cefc73c6a0af6d424c529e478c3
tree977f6dbb5dac044b1a431eb08cb212e580fbf498
parent4181eb13bf29a01682039c2bed1723a2824e32d9
audiomixer: rework event handling to avoid race conditions

Previously there was a race condition that would happen when
audiomixer was the first client to connect to pipewire.
It would get a session first and then a default endpoint id
from the session, but at the time the default endpoint id
would be known, the WpProxyEndpoints would still not be ready.
This would cause the populate_controls() algorithm to end up
with no controls and the binding would therefore report that
no controls were exposed.

Now we also handle objects-changed from the endpoints object manager.
This is an additional trigger, so that when we end up in the
situation described above, the objects-changed from the endpoints om
will trigger the controls to be exposed eventually.

In order to avoid signalling control changes all the time,
there are now some checks to change controls only under
certain conditions.

Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Change-Id: Icd48990c257d49396c9edc0b7299982338239f06
binding/audiomixer.c