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

Commit adf34bf9 authored by Andy Hung's avatar Andy Hung
Browse files

NuPlayer: Discard seeks when source and decoders are NULL

Problem occurs when loop mode asynchronously seeks to the
start of the source after a MediaPlayer::reset().

Bug: 17379148
Change-Id: I50bfe65a753afffb1d478db54c76067a9c61a0ae
parent 6a548e91
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1665,6 +1665,14 @@ void NuPlayer::performSeek(int64_t seekTimeUs) {
          seekTimeUs,
          seekTimeUs / 1E6);

    if (mSource == NULL) {
        // This happens when reset occurs right before the loop mode
        // asynchronously seeks to the start of the stream.
        LOG_ALWAYS_FATAL_IF(mAudioDecoder != NULL || mVideoDecoder != NULL,
                "mSource is NULL and decoders not NULL audio(%p) video(%p)",
                mAudioDecoder.get(), mVideoDecoder.get());
        return;
    }
    mSource->seekTo(seekTimeUs);
    ++mTimedTextGeneration;

+1 −1
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ void NuPlayerDriver::notifyListener_l(
    switch (msg) {
        case MEDIA_PLAYBACK_COMPLETE:
        {
            if (mLooping) {
            if (mLooping && mState != STATE_RESET_IN_PROGRESS) {
                mLock.unlock();
                mPlayer->seekToAsync(0);
                mLock.lock();