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

Commit 768f8dbf authored by Naresh Tanniru's avatar Naresh Tanniru Committed by Steve Kondik
Browse files

Audio: Tunnel Exception for AAC main profile format

- Audio is not decoding properly for some mp4 content

- ADSP audio decoders don't support aac main profile

- Added tunnel exception for AAC main profile format

Change-Id: I8470457492e32d94ab36eea7b97f4e4ec8776bb4
parent 1d54d8d4
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -3386,6 +3386,9 @@ bool AwesomePlayer::inSupportedTunnelFormats(const char * mime) {

void AwesomePlayer::checkTunnelExceptions()
{
    if(!mIsTunnelAudio) {
        return;
    }
    /* exception 1: No streaming */
    if (isStreamingHTTP()) {
        ALOGV("Streaming, force disable tunnel mode playback");
@@ -3414,13 +3417,26 @@ void AwesomePlayer::checkTunnelExceptions()
        return;
    }

    /* exception 4: check for  AAC mainprofile , it is not supported */
    sp<MetaData> metaData  = mAudioTrack->getFormat();
    const char * mime;
    int32_t objecttype = 0;

    if (metaData->findCString(kKeyMIMEType, &mime) &&
           !strcmp(mime, MEDIA_MIMETYPE_AUDIO_AAC) &&
           (metaData->findInt32(kKeyAACProfile, &objecttype) && (1 == objecttype))) {
        ALOGD("FOUND AAC Main Profile, disable tunnel mode");
        mIsTunnelAudio = false;
        return;
    }

    /* below exceptions are only for av content */
    if (mVideoTrack == NULL) return;

    /* exception 3: No avi having video + mp3 */
    if (mExtractor == NULL) return;

    sp<MetaData> metaData = mExtractor->getMetaData();
    metaData = mExtractor->getMetaData();
    const char * container;

    /*only proceed for avi content.*/
@@ -3429,7 +3445,6 @@ void AwesomePlayer::checkTunnelExceptions()
        return;
    }

    const char * mime;
    metaData = mAudioTrack->getFormat();
    /*disable for av content having mp3*/
    if (metaData->findCString(kKeyMIMEType, &mime) &&
+8 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2009 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2389,6 +2392,11 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
        objectType = 32 + br.getBits(6);
    }

    if(objectType == 1) { //AAC Main profile
        ALOGD("\n >>> Found AAC mainprofile in MPEG4 Extractor... \n");
    }

    mLastTrack->meta->setInt32(kKeyAACProfile, objectType);
    uint32_t freqIndex = br.getBits(4);

    int32_t sampleRate = 0;