Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5592ee26 authored by François Gaffie's avatar François Gaffie Committed by Eric Laurent
Browse files

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: default avatarFrançois Gaffie <francois.gaffie@renault.com>
parent f9b3d532
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment