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

Commit 3d968a5a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "heif: skip A/V track specific code"

parents e34500b7 a4d7b690
Loading
Loading
Loading
Loading
+183 −172
Original line number Diff line number Diff line
@@ -2951,6 +2951,8 @@ status_t MPEG4Writer::Track::threadEntry() {
            mGotStartKeyFrame = true;
        }
////////////////////////////////////////////////////////////////////////////////

        if (!mIsHeic) {
            if (mStszTableEntries->count() == 0) {
                mFirstSampleTimeRealUs = systemTime() / 1000;
                mStartTimestampUs = timestampUs;
@@ -3158,6 +3160,7 @@ status_t MPEG4Writer::Track::threadEntry() {
                }
                trackProgressStatus(timestampUs);
            }
        }
        if (!hasMultipleTracks) {
            size_t bytesWritten;
            off64_t offset = mOwner->addSample_l(copy, usePrefix(), &bytesWritten);
@@ -4331,9 +4334,12 @@ void MPEG4Writer::writeFileLevelMetaBox() {
    }

    // patch up the mPrimaryItemId and count items with prop associations
    uint16_t firstVisibleItemId = 0;
    for (size_t index = 0; index < mItems.size(); index++) {
        if (mItems[index].isPrimary) {
            mPrimaryItemId = mItems[index].itemId;
        } else if (!firstVisibleItemId && !mItems[index].isHidden) {
            firstVisibleItemId = mItems[index].itemId;
        }

        if (!mItems[index].properties.empty()) {
@@ -4342,9 +4348,14 @@ void MPEG4Writer::writeFileLevelMetaBox() {
    }

    if (mPrimaryItemId == 0) {
        ALOGW("didn't find primary, using first item");
        if (firstVisibleItemId > 0) {
            ALOGW("didn't find primary, using first visible item");
            mPrimaryItemId = firstVisibleItemId;
        } else {
            ALOGW("no primary and no visible item, using first item");
            mPrimaryItemId = mItems[0].itemId;
        }
    }

    beginBox("meta");
    writeInt32(0); // Version = 0, Flags = 0