summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-02-01 10:51:50 -0800
committerAndreas Huber <andih@google.com>2010-02-01 10:53:20 -0800
commit78d529eb330ab6c04b5c694403f5a7e7de4b702f (patch)
tree7f686e70cae863eb1d5b4fa2427c30075beecb84 /media/libstagefright/OMXCodec.cpp
parent036a38099c9d339d77dc4a1a148db2907a618c2e (diff)
downloadframeworks_av-78d529eb330ab6c04b5c694403f5a7e7de4b702f.zip
frameworks_av-78d529eb330ab6c04b5c694403f5a7e7de4b702f.tar.gz
frameworks_av-78d529eb330ab6c04b5c694403f5a7e7de4b702f.tar.bz2
The TI MP3 decoder lies about the number of channels it outputs, add a quirk for that.
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index e17fbb8..90bbdfe 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -290,6 +290,7 @@ uint32_t OMXCodec::getComponentQuirks(const char *componentName) {
}
if (!strcmp(componentName, "OMX.TI.MP3.decode")) {
quirks |= kNeedsFlushBeforeDisable;
+ quirks |= kDecoderLiesAboutNumberOfChannels;
}
if (!strcmp(componentName, "OMX.TI.AAC.decode")) {
quirks |= kNeedsFlushBeforeDisable;
@@ -2817,7 +2818,9 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) {
if ((OMX_U32)numChannels != params.nChannels) {
LOGW("Codec outputs a different number of channels than "
- "the input stream contains.");
+ "the input stream contains (contains %d channels, "
+ "codec outputs %ld channels).",
+ numChannels, params.nChannels);
}
mOutputFormat->setCString(
@@ -2825,8 +2828,12 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) {
// Use the codec-advertised number of channels, as some
// codecs appear to output stereo even if the input data is
- // mono.
- mOutputFormat->setInt32(kKeyChannelCount, params.nChannels);
+ // mono. If we know the codec lies about this information,
+ // use the actual number of channels instead.
+ mOutputFormat->setInt32(
+ kKeyChannelCount,
+ (mQuirks & kDecoderLiesAboutNumberOfChannels)
+ ? numChannels : params.nChannels);
// The codec-reported sampleRate is not reliable...
mOutputFormat->setInt32(kKeySampleRate, sampleRate);