summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-06-29 20:20:04 -0700
committer The Android Open Source Project <initial-contribution@android.com> 2009-06-29 20:20:04 -0700
commit548b9920a8d2eeaf98016e9a9eab15578d6e641f (patch)
treed806ec477523a5739894d3128871598c9ad47fe3
parentb8990f39b0d8d4a74127e295590cc576c78bd56c (diff)
parent2d9f31697fb5ece89c80cc66bdd3bd9caa9df9c3 (diff)
am 2d9f3169: Merge change 5595 into donut
Merge commit '2d9f31697fb5ece89c80cc66bdd3bd9caa9df9c3' * commit '2d9f31697fb5ece89c80cc66bdd3bd9caa9df9c3': We might try to close the Vorbis file twice under certain
-rw-r--r--media/libmediaplayerservice/VorbisPlayer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/VorbisPlayer.cpp b/media/libmediaplayerservice/VorbisPlayer.cpp
index 14fd6cedcfad..7f0ef217f2b1 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;