diff options
author | Andreas Huber <andih@google.com> | 2013-04-17 16:38:17 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-04-17 16:38:17 -0700 |
commit | 8160921de80aeff12436ee1c2bfdae77fc4914b9 (patch) | |
tree | 91ba5f8c1c3000505d9e7eb415942cdebd7b3141 /media/libstagefright/ACodec.cpp | |
parent | c7e45e2439959c584931aa22c6c3b9d1f08320d8 (diff) | |
parent | c9e18491b4dd6d82d52ec7baa2101732ab617db6 (diff) | |
download | frameworks_av-8160921de80aeff12436ee1c2bfdae77fc4914b9.zip frameworks_av-8160921de80aeff12436ee1c2bfdae77fc4914b9.tar.gz frameworks_av-8160921de80aeff12436ee1c2bfdae77fc4914b9.tar.bz2 |
am c9e18491: am 767fea95: Merge "Apparently the mp3 decoder glitches if it was configured with the wrong" into jb-mr2-dev
* commit 'c9e18491b4dd6d82d52ec7baa2101732ab617db6':
Apparently the mp3 decoder glitches if it was configured with the wrong
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index ee49033..b3bc6d8 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -960,6 +960,19 @@ status_t ACodec::configureCodec( err = setupVideoDecoder(mime, width, height); } } + } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) { + int32_t numChannels, sampleRate; + if (!msg->findInt32("channel-count", &numChannels) + || !msg->findInt32("sample-rate", &sampleRate)) { + // Since we did not always check for these, leave them optional + // and have the decoder figure it all out. + err = OK; + } else { + err = setupRawAudioFormat( + encoder ? kPortIndexInput : kPortIndexOutput, + sampleRate, + numChannels); + } } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) { int32_t numChannels, sampleRate; if (!msg->findInt32("channel-count", &numChannels) |