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

Commit a16898d6 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "Fix mediaserver crash issue" am: 518ccbc5 am: 2f6c0e51 am: 5bd56e19 am: 96df9327

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1913455

Change-Id: I3d27f855a522ac1582161bb645beb61b1005ffa7
parents 2fb27c51 96df9327
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -243,11 +243,13 @@ void AudioRecord::stopAndJoinCallbacks() {
        mAudioRecordThread->requestExitAndWait();
        mAudioRecordThread.clear();
    }
    // No lock here: worst case we remove a NULL callback which will be a nop

    AutoMutex lock(mLock);
    if (mDeviceCallback != 0 && mInput != AUDIO_IO_HANDLE_NONE) {
        // This may not stop all of these device callbacks!
        // TODO: Add some sort of protection.
        AudioSystem::removeAudioDeviceCallback(this, mInput, mPortId);
        mDeviceCallback.clear();
    }
}
namespace {
+2 −1
Original line number Diff line number Diff line
@@ -476,7 +476,8 @@ void AudioTrack::stopAndJoinCallbacks() {
        mAudioTrackThread->requestExitAndWait();
        mAudioTrackThread.clear();
    }
    // No lock here: worst case we remove a NULL callback which will be a nop

    AutoMutex lock(mLock);
    if (mDeviceCallback != 0 && mOutput != AUDIO_IO_HANDLE_NONE) {
        // This may not stop all of these device callbacks!
        // TODO: Add some sort of protection.