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

Commit e0d588b8 authored by Robert Shih's avatar Robert Shih Committed by android-build-merger
Browse files

SampleIterator: clear members on seekTo error am: 03237ce0

am: 8468b898

Change-Id: I4d81b7bd8732f03d0308740b96418203d17cd65b
parents 085a4173 8468b898
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -94,8 +94,6 @@ status_t SampleIterator::seekTo(uint32_t sampleIndex) {
        + mFirstChunk;

    if (!mInitialized || chunk != mCurrentChunkIndex) {
        mCurrentChunkIndex = chunk;

        status_t err;
        if ((err = getChunkOffset(chunk, &mCurrentChunkOffset)) != OK) {
            ALOGE("getChunkOffset return error");
@@ -106,18 +104,21 @@ status_t SampleIterator::seekTo(uint32_t sampleIndex) {

        uint32_t firstChunkSampleIndex =
            mFirstChunkSampleIndex
                + mSamplesPerChunk * (mCurrentChunkIndex - mFirstChunk);
                + mSamplesPerChunk * (chunk - mFirstChunk);

        for (uint32_t i = 0; i < mSamplesPerChunk; ++i) {
            size_t sampleSize;
            if ((err = getSampleSizeDirect(
                            firstChunkSampleIndex + i, &sampleSize)) != OK) {
                ALOGE("getSampleSizeDirect return error");
                mCurrentChunkSampleSizes.clear();
                return err;
            }

            mCurrentChunkSampleSizes.push(sampleSize);
        }

        mCurrentChunkIndex = chunk;
    }

    uint32_t chunkRelativeSampleIndex =