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

Commit cc9833b5 authored by James Dong's avatar James Dong
Browse files

Only send port settings changed if the number of channels and sample rate are...

Only send port settings changed if the number of channels and sample rate are both known to be valid.

Change-Id: I9f8813eedc95db202488d8860cf485bdb8e69e11
related-to-bug: 6553089
parent 4364d2d1
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -293,12 +293,18 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) {
        info->mOwnedByUs = false;
        notifyEmptyBufferDone(header);

        // Only send out port settings changed event if both sample rate
        // and numChannels are valid.
        if (mStreamInfo->sampleRate && mStreamInfo->numChannels) {
            maybeConfigureDownmix();
            ALOGI("Initially configuring decoder: %d Hz, %d channels",
                mStreamInfo->sampleRate,
                mStreamInfo->numChannels);

            notify(OMX_EventPortSettingsChanged, 1, 0, NULL);
            mOutputPortSettingsChange = AWAITING_DISABLED;
        }

        return;
    }