Merge "Make sure not to cancel pending seek/EOS notifications on a cache underrun..." into ics-mr1

This commit is contained in:
Andreas Huber
2011-11-17 09:05:17 -08:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 8 deletions

View File

@@ -224,17 +224,18 @@ AwesomePlayer::~AwesomePlayer() {
mClient.disconnect();
}
void AwesomePlayer::cancelPlayerEvents(bool keepBufferingGoing) {
void AwesomePlayer::cancelPlayerEvents(bool keepNotifications) {
mQueue.cancelEvent(mVideoEvent->eventID());
mVideoEventPending = false;
mQueue.cancelEvent(mStreamDoneEvent->eventID());
mStreamDoneEventPending = false;
mQueue.cancelEvent(mCheckAudioStatusEvent->eventID());
mAudioStatusEventPending = false;
mQueue.cancelEvent(mVideoLagEvent->eventID());
mVideoLagEventPending = false;
if (!keepBufferingGoing) {
if (!keepNotifications) {
mQueue.cancelEvent(mStreamDoneEvent->eventID());
mStreamDoneEventPending = false;
mQueue.cancelEvent(mCheckAudioStatusEvent->eventID());
mAudioStatusEventPending = false;
mQueue.cancelEvent(mBufferingEvent->eventID());
mBufferingEventPending = false;
}
@@ -1095,7 +1096,7 @@ status_t AwesomePlayer::pause_l(bool at_eos) {
return OK;
}
cancelPlayerEvents(true /* keepBufferingGoing */);
cancelPlayerEvents(true /* keepNotifications */);
if (mAudioPlayer != NULL && (mFlags & AUDIO_RUNNING)) {
if (at_eos) {

View File

@@ -250,7 +250,7 @@ private:
void notifyVideoSize_l();
void seekAudioIfNecessary_l();
void cancelPlayerEvents(bool keepBufferingGoing = false);
void cancelPlayerEvents(bool keepNotifications = false);
void setAudioSource(sp<MediaSource> source);
status_t initAudioDecoder();