diff options
author | Keith Mok <kmok@cyngn.com> | 2015-12-16 12:02:04 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-12-17 02:16:55 -0800 |
commit | 53ac41b011537674ae823bc38df2fea7b369c894 (patch) | |
tree | dddaad15a1a99d23b91714505378cf5beb14cf4a | |
parent | f45ba7f3ce8e844f35129ac576ec8c581dfe337f (diff) | |
download | frameworks_av-53ac41b011537674ae823bc38df2fea7b369c894.zip frameworks_av-53ac41b011537674ae823bc38df2fea7b369c894.tar.gz frameworks_av-53ac41b011537674ae823bc38df2fea7b369c894.tar.bz2 |
stagefright: Fix some aac file cannot be played back
The AACExtractor does not pass the aacprofile via
kKeyAACAOT and google aac decoder does not support LTP profile.
Solve by setting the kKeyAACAOT profile and use ffmpeg
when it is aac LTP profile.
Change-Id: I79762bd23e3bcc34f2ea56e35686162f1630c06b
-rw-r--r-- | media/libstagefright/AACExtractor.cpp | 1 | ||||
-rw-r--r-- | media/libstagefright/FFMPEGSoftCodec.cpp | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/media/libstagefright/AACExtractor.cpp b/media/libstagefright/AACExtractor.cpp index 1353e3f..2115eb4 100644 --- a/media/libstagefright/AACExtractor.cpp +++ b/media/libstagefright/AACExtractor.cpp @@ -167,6 +167,7 @@ AACExtractor::AACExtractor( channel = (header[0] & 0x1) << 2 | (header[1] >> 6); mMeta = MakeAACCodecSpecificData(profile, sf_index, channel); + mMeta->setInt32(kKeyAACAOT, profile + 1); off64_t streamSize, numFrames = 0; size_t frameSize = 0; diff --git a/media/libstagefright/FFMPEGSoftCodec.cpp b/media/libstagefright/FFMPEGSoftCodec.cpp index ddb688a..5ee168e 100644 --- a/media/libstagefright/FFMPEGSoftCodec.cpp +++ b/media/libstagefright/FFMPEGSoftCodec.cpp @@ -217,8 +217,8 @@ const char* FFMPEGSoftCodec::overrideComponentName( int32_t aacProfile = 0; if (!isEncoder && !strncasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC, strlen(MEDIA_MIMETYPE_AUDIO_AAC)) && meta->findInt32(kKeyAACAOT, &aacProfile)) { - if (aacProfile == OMX_AUDIO_AACObjectMain) { - ALOGD("Use FFMPEG for AAC MAIN profile"); + if ((aacProfile == OMX_AUDIO_AACObjectMain) || (aacProfile == OMX_AUDIO_AACObjectLTP)) { + ALOGD("Use FFMPEG for AAC Main/LTP profile"); componentName = "OMX.ffmpeg.aac.decoder"; } } @@ -250,8 +250,8 @@ void FFMPEGSoftCodec::overrideComponentName( int32_t aacProfile = 0; if (!isEncoder && !strncasecmp(mime->c_str(), MEDIA_MIMETYPE_AUDIO_AAC, strlen(MEDIA_MIMETYPE_AUDIO_AAC)) && msg->findInt32(getMsgKey(kKeyAACAOT), &aacProfile)) { - if (aacProfile == OMX_AUDIO_AACObjectMain) { - ALOGD("Use FFMPEG for AAC MAIN profile"); + if ((aacProfile == OMX_AUDIO_AACObjectMain) || (aacProfile == OMX_AUDIO_AACObjectLTP)) { + ALOGD("Use FFMPEG for AAC Main/LTP profile"); componentName->setTo("OMX.ffmpeg.aac.decoder"); } } |