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.

Change-Id: I84286030eaae9061077d6ccb485b7dd53ef05341
This commit is contained in:
Gloria Wang
2010-04-12 17:13:06 -07:00
parent bcac496076
commit b19da8e187

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;