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

Commit f77493e6 authored by Andreas Huber's avatar Andreas Huber
Browse files

Fix the software AAC decoder's AAC+ detection to ignore malformed frames

at the beginning of the stream.

Change-Id: Ib990848c696896e7d43c80dec8119dec35704b74
related-to-bug: 5122512
parent d5962a12
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -316,7 +316,7 @@ void SoftAAC::onQueueFilled(OMX_U32 portIndex) {
         * Thus, we could not say for sure whether a stream is
         * Thus, we could not say for sure whether a stream is
         * AAC+/eAAC+ until the first data frame is decoded.
         * AAC+/eAAC+ until the first data frame is decoded.
         */
         */
        if (mInputBufferCount <= 2) {
        if (decoderErr == MP4AUDEC_SUCCESS && mInputBufferCount <= 2) {
            LOGV("audio/extended audio object type: %d + %d",
            LOGV("audio/extended audio object type: %d + %d",
                mConfig->audioObjectType, mConfig->extendedAudioObjectType);
                mConfig->audioObjectType, mConfig->extendedAudioObjectType);
            LOGV("aac+ upsampling factor: %d desired channels: %d",
            LOGV("aac+ upsampling factor: %d desired channels: %d",
@@ -410,9 +410,11 @@ void SoftAAC::onQueueFilled(OMX_U32 portIndex) {
        notifyFillBufferDone(outHeader);
        notifyFillBufferDone(outHeader);
        outHeader = NULL;
        outHeader = NULL;


        if (decoderErr == MP4AUDEC_SUCCESS) {
            ++mInputBufferCount;
            ++mInputBufferCount;
        }
        }
    }
    }
}


void SoftAAC::onPortFlushCompleted(OMX_U32 portIndex) {
void SoftAAC::onPortFlushCompleted(OMX_U32 portIndex) {
    if (portIndex == 0) {
    if (portIndex == 0) {