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

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

Merge "Return a runtime error instead of assertion if seeking beyond EOS in mpeg4 files."

parents 3475ebfa 90ba107f
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -1972,6 +1972,12 @@ status_t MPEG4Source::read(
                    sampleIndex, &syncSampleIndex, findFlags);
                    sampleIndex, &syncSampleIndex, findFlags);
        }
        }


        uint32_t sampleTime;
        if (err == OK) {
            err = mSampleTable->getMetaDataForSample(
                    sampleIndex, NULL, NULL, &sampleTime);
        }

        if (err != OK) {
        if (err != OK) {
            if (err == ERROR_OUT_OF_RANGE) {
            if (err == ERROR_OUT_OF_RANGE) {
                // An attempt to seek past the end of the stream would
                // An attempt to seek past the end of the stream would
@@ -1984,10 +1990,6 @@ status_t MPEG4Source::read(
            return err;
            return err;
        }
        }


        uint32_t sampleTime;
        CHECK_EQ((status_t)OK, mSampleTable->getMetaDataForSample(
                    sampleIndex, NULL, NULL, &sampleTime));

        if (mode == ReadOptions::SEEK_CLOSEST) {
        if (mode == ReadOptions::SEEK_CLOSEST) {
            targetSampleTimeUs = (sampleTime * 1000000ll) / mTimescale;
            targetSampleTimeUs = (sampleTime * 1000000ll) / mTimescale;
        }
        }