diff options
author | Andreas Huber <andih@google.com> | 2010-02-26 09:47:28 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-02-26 09:47:28 -0800 |
commit | 42569ac261af2cf8cefd0922a890c31b759c37b8 (patch) | |
tree | 9617ab037ae403a09cf36841b0e51a67778525dd /media/libstagefright/codecs/aacdec/AACDecoder.cpp | |
parent | d2d947bc8717697e983062147b51b5a0e307b84f (diff) | |
download | frameworks_av-42569ac261af2cf8cefd0922a890c31b759c37b8.zip frameworks_av-42569ac261af2cf8cefd0922a890c31b759c37b8.tar.gz frameworks_av-42569ac261af2cf8cefd0922a890c31b759c37b8.tar.bz2 |
The PV aac software decoder screws up if playing a mono-AACplus stream unless we output stereo data. Now we always output stereo data as the legacy OMX nodes did.
related-to-bug: 2472545
Diffstat (limited to 'media/libstagefright/codecs/aacdec/AACDecoder.cpp')
-rw-r--r-- | media/libstagefright/codecs/aacdec/AACDecoder.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/media/libstagefright/codecs/aacdec/AACDecoder.cpp b/media/libstagefright/codecs/aacdec/AACDecoder.cpp index ff51e88..f0b66c9 100644 --- a/media/libstagefright/codecs/aacdec/AACDecoder.cpp +++ b/media/libstagefright/codecs/aacdec/AACDecoder.cpp @@ -57,9 +57,9 @@ status_t AACDecoder::start(MetaData *params) { mConfig->aacPlusUpsamplingFactor = 0; mConfig->aacPlusEnabled = false; - int32_t numChannels; - CHECK(mSource->getFormat()->findInt32(kKeyChannelCount, &numChannels)); - mConfig->desiredChannels = numChannels; + // The software decoder doesn't properly support mono output on + // AACplus files. Always output stereo. + mConfig->desiredChannels = 2; UInt32 memRequirements = PVMP4AudioDecoderGetMemRequirements(); mDecoderBuf = malloc(memRequirements); @@ -127,14 +127,16 @@ status_t AACDecoder::stop() { sp<MetaData> AACDecoder::getFormat() { sp<MetaData> srcFormat = mSource->getFormat(); - int32_t numChannels; int32_t sampleRate; - CHECK(srcFormat->findInt32(kKeyChannelCount, &numChannels)); CHECK(srcFormat->findInt32(kKeySampleRate, &sampleRate)); sp<MetaData> meta = new MetaData; meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_RAW); - meta->setInt32(kKeyChannelCount, numChannels); + + // We'll always output stereo, regardless of how many channels are + // present in the input due to decoder limitations. + meta->setInt32(kKeyChannelCount, 2); + meta->setInt32(kKeySampleRate, sampleRate); int64_t durationUs; |