Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6479b955 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

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

parents 7b81bc3b c34233e6
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -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(mVideoLagEvent->eventID());
    mVideoLagEventPending = false;

    if (!keepNotifications) {
        mQueue.cancelEvent(mStreamDoneEvent->eventID());
        mStreamDoneEventPending = false;
        mQueue.cancelEvent(mCheckAudioStatusEvent->eventID());
        mAudioStatusEventPending = false;
    mQueue.cancelEvent(mVideoLagEvent->eventID());
    mVideoLagEventPending = false;

    if (!keepBufferingGoing) {
        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) {
+1 −1
Original line number Diff line number Diff line
@@ -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();