summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-08-10 12:24:59 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2012-08-13 17:27:28 -0700
commit5696a4efef79ee474ac6bcf2639c741e159bed1b (patch)
treeb435c5616319b2ea591e81e171d1303070332b65 /media/libstagefright/codecs/aacdec/SoftAAC2.cpp
parent7edbacf24e60c01e2d3b10715ec8f9cc2f55c11a (diff)
downloadframeworks_av-5696a4efef79ee474ac6bcf2639c741e159bed1b.zip
frameworks_av-5696a4efef79ee474ac6bcf2639c741e159bed1b.tar.gz
frameworks_av-5696a4efef79ee474ac6bcf2639c741e159bed1b.tar.bz2
Fix AAC DRC metadata being ignored
The decoder will bypass all DRC processing during decode unless any of the DRC parameters is set. The fix consists in setting the DRC reference level to its default value when after the decoder is initialized. Change-Id: Ibb8355ab8c3c65020c5eef0752957040f7316c2a
Diffstat (limited to 'media/libstagefright/codecs/aacdec/SoftAAC2.cpp')
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC2.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
index 566b1db..040a7be 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
@@ -26,6 +26,8 @@
#define FILEREAD_MAX_LAYERS 2
+#define DRC_DEFAULT_REF_LEVEL 108 /* 108*0.25dB = -27 dB below full scale (typical for movies) */
+
namespace android {
template<class T>
@@ -110,6 +112,9 @@ status_t SoftAAC2::initDecoder() {
}
}
mIsFirst = true;
+ // the decoder will bypass all DRC processing during decode unless any of the DRC parameters
+ // is set, so here we just reset the DRC reference level to its default value.
+ aacDecoder_SetParam(mAACDecoder, AAC_DRC_REFERENCE_LEVEL, DRC_DEFAULT_REF_LEVEL);
return status;
}