audiopolicy: fix source client lifecycle
Upon startAudioSource -> connectAudioSource, the source client
is attached to the output.
Upon stopAudioSource -> disconnectAudioSource, the source client is
never removed.
As a result, if the same client is trying to call startAudioSource again,
asthe client is already attached, getClient will lead to bailing out in
connectAudioSource and the source will not be started.
The stopAudioSource if called would claim that the client refcount is already 0.
Any following call to start would fail again on outputDesc->start as invalid
as the profile fails on canStartNewIo.
This CL fixes this issue by removing the client source desc on disconnectAudioSource.
Bug: 133367802
Test: build & run
AudioPolicyEmulatorTests --gtest_filter=*AudioSourceEffectTest*
multiple consecutive times.
Change-Id: I78370be248ff24cf4135d51f709d965c5bfae4e8
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Loading
Please register or sign in to comment