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

Commit b06fb9fa authored by Iris Chang's avatar Iris Chang Committed by Marco Nelissen
Browse files

Cannot play back mov file which contains udta atom

When we play back mov file which contains udta atom
and udta terminates with code x00000000, parsing
chunk has error. Solution is to pass udta terminated
code to play file.

Bug: 122749421
Test: Play the video file whose udta terminates with
x00000000 and check if it can play normally

Change-Id: Ifd87ffb943d019d10bba1dfd9b0d822d3ba37727
parent 0e7fbcb1
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) {