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

Commit 14b2e8b5 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...

SampleIterator: clear members on seekTo error am: 03237ce0 am: 8468b898 am: e0d588b8 am: d4ddd555 am: f72b9e00 am: 21beb40c am: dcaab8ed am: a38b5af1 am: 95eb4e76
am: 4cb38415

Change-Id: I8804226ce1fca11e478bda906585b5b065e09124
parents 3fb31ed7 4cb38415
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 =