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

Commit 44a9bf5b authored by Wei Jia's avatar Wei Jia
Browse files

MPEG4Extractor: support version 1 for trun box.

Bug: 30936893
Change-Id: Ibe1d5683d435b6e7b17784d289e9bb94e89379f3
parent c486605e
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -4109,11 +4109,13 @@ status_t MPEG4Source::parseTrackFragmentRun(off64_t offset, off64_t size) {
    if (!mDataSource->getUInt32(offset, &flags)) {
        return ERROR_MALFORMED;
    }
    ALOGV("fragment run flags: %08x", flags);

    if (flags & 0xff000000) {
        return -EINVAL;
    }
    // |version| only affects SampleCompositionTimeOffset field.
    // If version == 0, SampleCompositionTimeOffset is uint32_t;
    // Otherwise, SampleCompositionTimeOffset is int32_t.
    // Sample.compositionOffset is defined as int32_t.
    uint8_t version = flags >> 24;
    flags &= 0xffffff;
    ALOGV("fragment run version: 0x%02x, flags: 0x%06x", version, flags);

    if ((flags & kFirstSampleFlagsPresent) && (flags & kSampleFlagsPresent)) {
        // These two shall not be used together.