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

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

Merge "Properly flush the AudioTrack/AudioSink on a seek request and make sure...

Merge "Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content." into gingerbread
parents 6d028dd2 ad3fcfe8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -423,6 +423,12 @@ status_t AudioPlayer::seekTo(int64_t time_us) {
    mReachedEOS = false;
    mSeekTimeUs = time_us;

    if (mAudioSink != NULL) {
        mAudioSink->flush();
    } else {
        mAudioTrack->flush();
    }

    return OK;
}

+4 −0
Original line number Diff line number Diff line
@@ -171,6 +171,10 @@ status_t AACDecoder::read(
            mInputBuffer->release();
            mInputBuffer = NULL;
        }

        // Make sure that the next buffer output does not still
        // depend on fragments from the last one decoded.
        PVMP4AudioDecoderResetBuffer(mDecoderBuf);
    } else {
        seekTimeUs = -1;
    }
+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,10 @@ status_t MP3Decoder::read(
            mInputBuffer->release();
            mInputBuffer = NULL;
        }

        // Make sure that the next buffer output does not still
        // depend on fragments from the last one decoded.
        pvmp3_InitDecoder(mConfig, mDecoderBuf);
    } else {
        seekTimeUs = -1;
    }