summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacdec
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-05-30 10:26:31 -0700
committerJames Dong <jdong@google.com>2012-05-30 13:02:05 -0700
commitcc9833b5db0e96f12daddb90a747fd146627377d (patch)
tree9381b975e84aee3deff7e9a51e193bd5b1e1b600 /media/libstagefright/codecs/aacdec
parent4364d2d1fd712faed7e839b58fedba3f48f626d0 (diff)
downloadframeworks_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
Diffstat (limited to 'media/libstagefright/codecs/aacdec')
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC2.cpp18
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;
}