Skip to content

Commit c1b1709

Browse files
theandi666Android (Google) Code Review
authored andcommitted
Merge "Make sure not to cancel pending seek/EOS notifications on a cache underrun..." into ics-mr1
2 parents 775e986 + 22cf4b0 commit c1b1709

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

media/libstagefright/AwesomePlayer.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,18 @@ AwesomePlayer::~AwesomePlayer() {
224224
mClient.disconnect();
225225
}
226226

227-
void AwesomePlayer::cancelPlayerEvents(bool keepBufferingGoing) {
227+
void AwesomePlayer::cancelPlayerEvents(bool keepNotifications) {
228228
mQueue.cancelEvent(mVideoEvent->eventID());
229229
mVideoEventPending = false;
230-
mQueue.cancelEvent(mStreamDoneEvent->eventID());
231-
mStreamDoneEventPending = false;
232-
mQueue.cancelEvent(mCheckAudioStatusEvent->eventID());
233-
mAudioStatusEventPending = false;
234230
mQueue.cancelEvent(mVideoLagEvent->eventID());
235231
mVideoLagEventPending = false;
236232

237-
if (!keepBufferingGoing) {
233+
if (!keepNotifications) {
234+
mQueue.cancelEvent(mStreamDoneEvent->eventID());
235+
mStreamDoneEventPending = false;
236+
mQueue.cancelEvent(mCheckAudioStatusEvent->eventID());
237+
mAudioStatusEventPending = false;
238+
238239
mQueue.cancelEvent(mBufferingEvent->eventID());
239240
mBufferingEventPending = false;
240241
}
@@ -1095,7 +1096,7 @@ status_t AwesomePlayer::pause_l(bool at_eos) {
10951096
return OK;
10961097
}
10971098

1098-
cancelPlayerEvents(true /* keepBufferingGoing */);
1099+
cancelPlayerEvents(true /* keepNotifications */);
10991100

11001101
if (mAudioPlayer != NULL && (mFlags & AUDIO_RUNNING)) {
11011102
if (at_eos) {

media/libstagefright/include/AwesomePlayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ struct AwesomePlayer {
250250
void notifyVideoSize_l();
251251
void seekAudioIfNecessary_l();
252252

253-
void cancelPlayerEvents(bool keepBufferingGoing = false);
253+
void cancelPlayerEvents(bool keepNotifications = false);
254254

255255
void setAudioSource(sp<MediaSource> source);
256256
status_t initAudioDecoder();

0 commit comments

Comments
 (0)