audiomixer: rework event handling to avoid race conditions 71/23471/1 8.99.5 icefish/8.99.5 icefish_8.99.5
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 24 Dec 2019 09:36:06 +0000 (11:36 +0200)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 24 Dec 2019 17:54:36 +0000 (19:54 +0200)
commit242d8a1dcd3f15d5d7c173f45cdbf820d7b173d6
treeefac0b11459c04d4ba850771dfb33e5f0edf98eb
parentf2358d170b1ce4a46a136b02f3aa708c3221ba2f
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.

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