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

Commit 787aa597 authored by Eric Laurent's avatar Eric Laurent
Browse files

Fix issue 2363154: Speech synthesis fails to start over A2DP after media server process crash.

The problem is that after a media_server crash, the value of the A2DP output handle can change.
As this value is cached in AudioSystem for all client processes there can be a mismatch between the cached
and actual value after a media_server restart.

The fix consists in clearing the cached output handles and output to stream map values cached
in AudioSystem in AudioFlingerClient::binderDied() which is called when the media_server crashes.
parent 111d0367
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -348,6 +348,9 @@ void AudioSystem::AudioFlingerClient::binderDied(const wp<IBinder>& who) {
    Mutex::Autolock _l(AudioSystem::gLock);

    AudioSystem::gAudioFlinger.clear();
    // clear output handles and stream to output map caches
    AudioSystem::gStreamOutputMap.clear();
    AudioSystem::gOutputs.clear();

    if (gAudioErrorCallback) {
        gAudioErrorCallback(DEAD_OBJECT);