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

Commit 518ccbc5 authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

Merge "Fix mediaserver crash issue"

parents a864d783 116df6ab
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
@@ -357,7 +357,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.