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

Commit 12ee59de authored by Steve Kondik's avatar Steve Kondik
Browse files

libmedia: Fix crash during mediaserver restart

 * AudioFlinger may have shut down, there's no reason to segfault.

Change-Id: I7625ae4f6d7eab96260936c2f077776d961b3d5a
parent fd085d12
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -483,6 +483,12 @@ status_t AudioRecord::openRecord_l(size_t epoch)

    sp<IMemory> iMem;           // for cblk
    sp<IMemory> bufferMem;

    if (audioFlinger == NULL) {
        ALOGE("AudioFlinger was NULL!");
        return NO_INIT;
    }

    sp<IAudioRecord> record = audioFlinger->openRecord(input,
                                                       mSampleRate, mFormat,
                                                       mChannelMask,