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

Commit 6fb082ae authored by James Dong's avatar James Dong Committed by Android (Google) Code Review
Browse files

Merge "Make sure that the trackId starts from 1" into jb-mr1-dev

parents e2229fba 219f1951
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -428,7 +428,7 @@ status_t MPEG4Writer::addSource(const sp<MediaSource> &source) {
        ALOGE("Attempt to add source AFTER recording is started");
        return UNKNOWN_ERROR;
    }
    Track *track = new Track(this, source, mTracks.size());
    Track *track = new Track(this, source, 1 + mTracks.size());
    mTracks.push_back(track);

    return OK;
@@ -2693,7 +2693,7 @@ void MPEG4Writer::Track::writeTkhdBox(time_t now) {
    mOwner->writeInt32(0x07);          // version=0, flags=7
    mOwner->writeInt32(now);           // creation time
    mOwner->writeInt32(now);           // modification time
    mOwner->writeInt32(mTrackId + 1);  // track id starts with 1
    mOwner->writeInt32(mTrackId);      // track id starts with 1
    mOwner->writeInt32(0);             // reserved
    int64_t trakDurationUs = getDurationUs();
    int32_t mvhdTimeScale = mOwner->getTimeScale();