am d4c072d3: am b19da8e1: Fix for 2581725. Keep the last frame after resume(), and delete it in the next suspend() or reuse it if no new frame is available.

Merge commit 'd4c072d3f584db2cf9214c9d813c15d9e646c527' into kraken

* commit 'd4c072d3f584db2cf9214c9d813c15d9e646c527':
  Fix for 2581725. Keep the last frame after resume(), and delete it
This commit is contained in:
Gloria Wang
2010-04-13 11:53:52 -07:00
committed by Android Git Automerger

View File

@@ -1239,7 +1239,19 @@ status_t AwesomePlayer::suspend() {
Mutex::Autolock autoLock(mLock);
if (mSuspensionState != NULL) {
return INVALID_OPERATION;
if (mLastVideoBuffer == NULL) {
//go into here if video is suspended again
//after resuming without being played between
//them
SuspensionState *state = mSuspensionState;
mSuspensionState = NULL;
reset_l();
mSuspensionState = state;
return OK;
}
delete mSuspensionState;
mSuspensionState = NULL;
}
if (mFlags & PREPARING) {
@@ -1344,7 +1356,7 @@ status_t AwesomePlayer::resume() {
play_l();
}
delete state;
mSuspensionState = state;
state = NULL;
return OK;