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

Commit c65abc64 authored by James Dong's avatar James Dong Committed by Android Git Automerger
Browse files

am 3878fbed: am cc9833b5: Only send port settings changed if the number of...

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

* commit '3878fbed':
  Only send port settings changed if the number of channels and sample rate are both known to be valid.
parents 9d1e267c 3878fbed
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;
    }