From 978811960a226824ecacb5fab14fb2094f1e8a09 Mon Sep 17 00:00:00 2001 From: Dave Sparks Date: Fri, 26 Jun 2009 17:24:22 -0700 Subject: [PATCH] We might try to close the Vorbis file twice under certain circumstances. This fix nulls the mFile member so we don't try to close it twice. Bug 1904783. --- media/libmediaplayerservice/VorbisPlayer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/media/libmediaplayerservice/VorbisPlayer.cpp b/media/libmediaplayerservice/VorbisPlayer.cpp index 14fd6cedcfada..7f0ef217f2b18 100644 --- a/media/libmediaplayerservice/VorbisPlayer.cpp +++ b/media/libmediaplayerservice/VorbisPlayer.cpp @@ -345,9 +345,6 @@ status_t VorbisPlayer::reset() { LOGV("reset\n"); Mutex::Autolock l(mMutex); - if (mState != STATE_OPEN) { - return NO_ERROR; - } return reset_nosync(); } @@ -355,10 +352,13 @@ status_t VorbisPlayer::reset() status_t VorbisPlayer::reset_nosync() { // close file - ov_clear(&mVorbisFile); // this also closes the FILE if (mFile != NULL) { - LOGV("OOPS! Vorbis didn't close the file"); - fclose(mFile); + ov_clear(&mVorbisFile); // this also closes the FILE + if (mFile != NULL) { + LOGV("OOPS! Vorbis didn't close the file"); + fclose(mFile); + mFile = NULL; + } } mState = STATE_ERROR;