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

Commit 1e2a0e6a authored by Robert Shih's avatar Robert Shih
Browse files

MatroskaExtractor: skip track when codec id is NULL in addTracks

This is a more thorough version of commit
ea9ac8bf
in that it applies to both video and audio.

Bug: 17702053
Bug: 18872598
Change-Id: Idcea77bb7133ea0d02da8c484b4a0791db42740e
parent f105b28e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -925,6 +925,11 @@ void MatroskaExtractor::addTracks() {
        ALOGV("codec id = %s", codecID);
        ALOGV("codec name = %s", track->GetCodecNameAsUTF8());

        if (codecID == NULL) {
            ALOGW("unknown codecID is not supported.");
            continue;
        }

        size_t codecPrivateSize;
        const unsigned char *codecPrivate =
            track->GetCodecPrivate(codecPrivateSize);
@@ -941,10 +946,7 @@ void MatroskaExtractor::addTracks() {
                const mkvparser::VideoTrack *vtrack =
                    static_cast<const mkvparser::VideoTrack *>(track);

                if (codecID == NULL) {
                    ALOGW("unknown codecID is not supported.");
                    continue;
                } else if (!strcmp("V_MPEG4/ISO/AVC", codecID)) {
                if (!strcmp("V_MPEG4/ISO/AVC", codecID)) {
                    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_AVC);
                    meta->setData(kKeyAVCC, 0, codecPrivate, codecPrivateSize);
                } else if (!strcmp("V_MPEG4/ISO/ASP", codecID)) {