diff options
author | James Dong <jdong@google.com> | 2012-05-30 10:26:31 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-05-30 13:02:05 -0700 |
commit | cc9833b5db0e96f12daddb90a747fd146627377d (patch) | |
tree | 9381b975e84aee3deff7e9a51e193bd5b1e1b600 | |
parent | 4364d2d1fd712faed7e839b58fedba3f48f626d0 (diff) | |
download | frameworks_av-cc9833b5db0e96f12daddb90a747fd146627377d.zip frameworks_av-cc9833b5db0e96f12daddb90a747fd146627377d.tar.gz frameworks_av-cc9833b5db0e96f12daddb90a747fd146627377d.tar.bz2 |
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
-rw-r--r-- | media/libstagefright/codecs/aacdec/SoftAAC2.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp index 8dbff9e..ff95f9f 100644 --- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp +++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp @@ -293,12 +293,18 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) { info->mOwnedByUs = false; notifyEmptyBufferDone(header); - maybeConfigureDownmix(); - ALOGI("Initially configuring decoder: %d Hz, %d channels", - mStreamInfo->sampleRate, - mStreamInfo->numChannels); - notify(OMX_EventPortSettingsChanged, 1, 0, NULL); - mOutputPortSettingsChange = AWAITING_DISABLED; + // 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; } |