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

Commit 5f648974 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

mediaplayer: save thread id in MediaPlayer::reset()

Fix: 63905551
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Change-Id: I54f724d2b2e73e2ab08aa7cc07054afe6e0a8092
parent f34e3f27
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -649,8 +649,12 @@ status_t MediaPlayer::doSetRetransmitEndpoint(const sp<IMediaPlayer>& player) {
status_t MediaPlayer::reset()
{
    ALOGV("reset");
    mLockThreadId = getThreadId();
    Mutex::Autolock _l(mLock);
    return reset_l();
    status_t result = reset_l();
    mLockThreadId = 0;

    return result;
}

status_t MediaPlayer::setAudioStreamType(audio_stream_type_t type)
@@ -860,7 +864,7 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj)
    // this will deadlock.
    //
    // The threadId hack below works around this for the care of prepare,
    // seekTo and start within the same process.
    // seekTo, start, and reset within the same process.
    // FIXME: Remember, this is a hack, it's not even a hack that is applied
    // consistently for all use-cases, this needs to be revisited.
    if (mLockThreadId != getThreadId()) {