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

Commit 6a69e114 authored by Shengbao Xu's avatar Shengbao Xu Committed by Marco Nelissen
Browse files

Add mp2 container and codec support

AOSP doesn't support audio mp2 file, so mp2 audio file
with file extension .mp2 cannot be identified as an audio.

1. Add mp2 extension to mp3extractor.cpp and cannot use
mp2extractor as demuxer for mp2 file
2. Add MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II to Acodec.cpp when
configure omx component params; then audio channel and
samplerate can be configured correctly when init omx component

Bug: 123730913
Test: play mp2 file
Change-Id: I42d7cbc578f801df13f249ff41442f1ebf0e5180
parent 5479d73c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -708,6 +708,7 @@ static CreatorFunc Sniff(
}

static const char *extensions[] = {
    "mp2",
    "mp3",
    "mpeg",
    "mpg",
+2 −1
Original line number Diff line number Diff line
@@ -2092,7 +2092,8 @@ status_t ACodec::configureCodec(
        if (usingSwRenderer) {
            outputFormat->setInt32("using-sw-renderer", 1);
        }
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) {
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG) ||
        !strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II)) {
        int32_t numChannels, sampleRate;
        if (!msg->findInt32("channel-count", &numChannels)
                || !msg->findInt32("sample-rate", &sampleRate)) {