summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MediaPlayerService.cpp
diff options
context:
space:
mode:
authorBao Haojun <baohaojun@gmail.com>2014-05-16 13:20:19 +0800
committerBao Haojun <baohaojun@gmail.com>2014-05-17 15:15:41 +0800
commit5225ba0632e9dcf6fab562e4632ae8d6d4312959 (patch)
tree5eb4153611f426c1d6b8e1cd7885538a37cf0ff4 /media/libmediaplayerservice/MediaPlayerService.cpp
parent3059e27d0e18a427f3c19889aac86ea31ec0d5d1 (diff)
downloadframeworks_av-5225ba0632e9dcf6fab562e4632ae8d6d4312959.zip
frameworks_av-5225ba0632e9dcf6fab562e4632ae8d6d4312959.tar.gz
frameworks_av-5225ba0632e9dcf6fab562e4632ae8d6d4312959.tar.bz2
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: Bao Haojun <baohaojun@gmail.com> Signed-off-by: Wang Liang <wangliang@smartisan.cn>
Diffstat (limited to 'media/libmediaplayerservice/MediaPlayerService.cpp')
-rw-r--r--media/libmediaplayerservice/MediaPlayerService.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index a392b76..2fcec57 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -1289,7 +1289,6 @@ status_t MediaPlayerService::decode(int fd, int64_t offset, int64_t length,
Exit:
if (player != 0) player->reset();
- ::close(fd);
return status;
}