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

Commit 082aa3f3 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Don't purge effects we're about to start using

By acquiring the new session id before releasing the old, we prevent
purging existing effects with the new session id that aren't currently
attached but will be once the player is switched to the new session id.
b/8767565

Change-Id: I703881b69c5accd8832ac834246925a20ada4c21
parent 6aade605
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -575,8 +575,8 @@ status_t MediaPlayer::setAudioSessionId(int sessionId)
        return BAD_VALUE;
        return BAD_VALUE;
    }
    }
    if (sessionId != mAudioSessionId) {
    if (sessionId != mAudioSessionId) {
        AudioSystem::releaseAudioSessionId(mAudioSessionId);
        AudioSystem::acquireAudioSessionId(sessionId);
        AudioSystem::acquireAudioSessionId(sessionId);
        AudioSystem::releaseAudioSessionId(mAudioSessionId);
        mAudioSessionId = sessionId;
        mAudioSessionId = sessionId;
    }
    }
    return NO_ERROR;
    return NO_ERROR;