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

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

Merge "MKV supports MP3 audio whose CodecID is A_MS/ACM"

parents cc8e8e1d 9119ddd1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1557,6 +1557,21 @@ void MatroskaExtractor::addTracks() {
                } else if (!strcmp("A_FLAC", codecID)) {
                    AMediaFormat_setString(meta, AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_FLAC);
                    err = addFlacMetadata(meta, codecPrivate, codecPrivateSize);
                } else if ((!strcmp("A_MS/ACM", codecID))) {
                    if ((NULL == codecPrivate) || (codecPrivateSize < 30)) {
                        ALOGW("unsupported audio: A_MS/ACM has no valid private data: %s, size: %zu",
                               codecPrivate == NULL ? "null" : "non-null", codecPrivateSize);
                        continue;
                    } else {
                        uint16_t ID = *(uint16_t *)codecPrivate;
                        if (ID == 0x0055) {
                            AMediaFormat_setString(meta,
                                    AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_MPEG);
                        } else {
                            ALOGW("A_MS/ACM unsupported type , continue");
                            continue;
                        }
                    }
                } else {
                    ALOGW("%s is not supported.", codecID);
                    continue;