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

Commit 1aa9e9aa authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Fix timestamps after seek"

parents ba8da49e 1457bf40
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -319,8 +319,7 @@ status_t FragmentedMP4Parser::onSeekTo(bool wantAudio, int64_t position) {
        off_t totalOffset = mFirstMoofOffset;
        for (int i = 0; i < numSidxEntries; i++) {
            const SidxEntry *se = &info->mSidx[i];
            totalTime += se->mDurationUs;
            if (totalTime > position) {
            if (totalTime + se->mDurationUs > position) {
                mBuffer->setRange(0,0);
                mBufferPos = totalOffset;
                if (mFinalResult == ERROR_END_OF_STREAM) {
@@ -329,9 +328,10 @@ status_t FragmentedMP4Parser::onSeekTo(bool wantAudio, int64_t position) {
                    resumeIfNecessary();
                }
                info->mFragments.clear();
                info->mDecodingTime = position * info->mMediaTimeScale / 1000000ll;
                info->mDecodingTime = totalTime * info->mMediaTimeScale / 1000000ll;
                return OK;
            }
            totalTime += se->mDurationUs;
            totalOffset += se->mSize;
        }
    }