summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-04-16 16:35:19 -0700
committerAndreas Huber <andih@google.com>2013-04-17 09:45:51 -0700
commit2242fbd1d9327dff9c25ac2aba0fa7d5d471bb88 (patch)
tree5f2934995453ff4e4c5db0eb8bac92f5e93b6eb1 /media/libstagefright/OMXCodec.cpp
parent96ef6f1bb8c5832682a9576c0e43b6c85e4f5c1b (diff)
downloadframeworks_av-2242fbd1d9327dff9c25ac2aba0fa7d5d471bb88.zip
frameworks_av-2242fbd1d9327dff9c25ac2aba0fa7d5d471bb88.tar.gz
frameworks_av-2242fbd1d9327dff9c25ac2aba0fa7d5d471bb88.tar.bz2
Apparently the mp3 decoder glitches if it was configured with the wrong
sample rate. Make sure we tell it about the one the extractor provides. Change-Id: Ice5b9cf55485ca1a8f099a14be0202be9540e781 related-to-bug: 8621639
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 6c0779d..9d349a1 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -522,6 +522,17 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
CODEC_LOGE("setAACFormat() failed (err = %d)", err);
return err;
}
+ } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_MPEG, mMIME)) {
+ int32_t numChannels, sampleRate;
+ if (meta->findInt32(kKeyChannelCount, &numChannels)
+ && meta->findInt32(kKeySampleRate, &sampleRate)) {
+ // Since we did not always check for these, leave them optional
+ // and have the decoder figure it all out.
+ setRawAudioFormat(
+ mIsEncoder ? kPortIndexInput : kPortIndexOutput,
+ sampleRate,
+ numChannels);
+ }
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_ALAW, mMIME)
|| !strcasecmp(MEDIA_MIMETYPE_AUDIO_G711_MLAW, mMIME)) {
// These are PCM-like formats with a fixed sample rate but