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 'b19da8e187db1cf223463809148b7cb2d9e9751a' into froyo-plus-aosp

* commit 'b19da8e187db1cf223463809148b7cb2d9e9751a':
  Fix for 2581725. Keep the last frame after resume(), and delete it
This commit is contained in:
Gloria Wang
2010-04-13 09:54:44 -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;