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

Commit 657edb6e authored by Wei Jia's avatar Wei Jia Committed by android-build-merger
Browse files

MPEG4Extractor: support version 1 for trun box. am: 44a9bf5b

am: 00fd9ee7

Change-Id: I3b018d293340ad9b0ddf0299d6ee82f032de3b09
parents bdc5f966 00fd9ee7
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.