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

Skip to content
Commit 5225ba06 authored by Bao Haojun's avatar Bao Haojun
Browse files

Fix double close.



This patch will fix the double close issue in SoundPool::doLoad():

        status = MediaPlayer::decode(mFd, mOffset, mLength, &sampleRate, &numChannels, &format,
                                     mHeap, &mSize);
        ALOGV("close(%d)", mFd);
        ::close(mFd);
        mFd = -1;

In MediaPlayerService::decode() which is called directly by
MediaPlayer::decode(), the fd will be closed, and after it return, the
mFd will be closed again.

When the system is idle, the second close will fail with EBADFD, but if
the system is busy, the mFd will be reused with another open/socket/pipe
system call, and the second close will cause errors.

Change-Id: If709515392cd490fea569658202524c51f8df785
Signed-off-by: default avatarBao Haojun <baohaojun@gmail.com>
Signed-off-by: default avatarWang Liang <wangliang@smartisan.cn>
parent 3059e27d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment