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

Commit 594564c4 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Cannot play back mov file which contains udta atom"

parents 30a9b983 b06fb9fa
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -985,6 +985,22 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
            off64_t stop_offset = *offset + chunk_size;
            *offset = data_offset;
            while (*offset < stop_offset) {

                // pass udata terminate
                if (mIsQT && stop_offset - *offset == 4 && chunk_type == FOURCC("udta")) {
                    // handle the case that udta terminates with terminate code x00000000
                    // note that 0 terminator is optional and we just handle this case.
                    uint32_t terminate_code = 1;
                    mDataSource->readAt(*offset, &terminate_code, 4);
                    if (0 == terminate_code) {
                        *offset += 4;
                        ALOGD("Terminal code for udta");
                        continue;
                    } else {
                        ALOGW("invalid udta Terminal code");
                    }
                }

                status_t err = parseChunk(offset, depth + 1);
                if (err != OK) {
                    if (isTrack) {