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

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

Merge "Fix mediaserver crash issue" am: 518ccbc5 am: 2f6c0e51

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

Change-Id: I1ad1d91ca141044377ecd879f7f31650e1438316
parents a1524032 2f6c0e51
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -210,11 +210,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();
    }
}
status_t AudioRecord::set(
+2 −1
Original line number Diff line number Diff line
@@ -358,7 +358,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.