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

Commit a2d54aea authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 564fee36: Merge "Make sure we can properly shutdown even if" into ics-mr1

* commit '564fee36667e2699c59a29102136220dc2f65862':
  Make sure we can properly shutdown even if
parents d7dbc9e6 7609b230
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -463,11 +463,24 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
        {
            LOGV("kWhatReset");

            if (mRenderer != NULL) {
                // There's an edge case where the renderer owns all output
                // buffers and is paused, therefore the decoder will not read
                // more input data and will never encounter the matching
                // discontinuity. To avoid this, we resume the renderer.

                if (mFlushingAudio == AWAITING_DISCONTINUITY
                        || mFlushingVideo == AWAITING_DISCONTINUITY) {
                    mRenderer->resume();
                }
            }

            if (mFlushingAudio != NONE || mFlushingVideo != NONE) {
                // We're currently flushing, postpone the reset until that's
                // completed.

                LOGV("postponing reset");
                LOGV("postponing reset mFlushingAudio=%d, mFlushingVideo=%d",
                        mFlushingAudio, mFlushingVideo);

                mResetPostponed = true;
                break;
+6 −1
Original line number Diff line number Diff line
@@ -628,11 +628,16 @@ void NuPlayer::Renderer::onPause() {
        mAudioSink->pause();
    }

    LOGV("now paused audio queue has %d entries, video has %d entries",
         mAudioQueue.size(), mVideoQueue.size());

    mPaused = true;
}

void NuPlayer::Renderer::onResume() {
    CHECK(mPaused);
    if (!mPaused) {
        return;
    }

    if (mHasAudio) {
        mAudioSink->start();