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

Commit 891bdf85 authored by ScottPeterson's avatar ScottPeterson Committed by Steve Kondik
Browse files

framework: Add Nvidia codec quirks

Modifying the codec quirks in OMXCodec.cpp to add
the flag kDecoderLiesAboutNumberOfChannels, otherwise
mono files will play as stereo, and sound 2X speed.

Bug 809011

Change-Id: I5d4a788b54d7d803f8d5297162bb47a2abde4d6c
parent 5cd46d76
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ static sp<MediaSource> InstantiateSoftwareCodec(

static const CodecInfo kDecoderInfo[] = {
    { MEDIA_MIMETYPE_IMAGE_JPEG, "OMX.TI.JPEG.decode" },
    //{ MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.Nvidia.mp3.decoder" },
    { MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.Nvidia.mp3.decoder" },
//    { MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.TI.MP3.decode" },
    { MEDIA_MIMETYPE_AUDIO_MPEG, "MP3Decoder" },
//    { MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.PV.mp3dec" },
@@ -379,6 +379,14 @@ uint32_t OMXCodec::getComponentQuirks(
    if (!strcmp(componentName, "OMX.PV.avcdec")) {
        quirks |= kWantsNALFragments;
    }

    if (!strcmp(componentName, "OMX.Nvidia.amr.decoder") ||
         !strcmp(componentName, "OMX.Nvidia.amrwb.decoder") ||
         !strcmp(componentName, "OMX.Nvidia.aac.decoder") ||
         !strcmp(componentName, "OMX.Nvidia.mp3.decoder")) {
        quirks |= kDecoderLiesAboutNumberOfChannels;
    }

    if (!strcmp(componentName, "OMX.TI.MP3.decode")) {
        quirks |= kNeedsFlushBeforeDisable;
        quirks |= kDecoderLiesAboutNumberOfChannels;