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

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

am cc9833b5: Only send port settings changed if the number of channels and...

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

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