summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.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/ACodec.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/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp13
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)