summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-09-09 10:27:08 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2012-09-09 10:27:08 -0700
commit82016dab001142124f1ab1eba1850b5687a4f936 (patch)
treec96e074c2eb06c2e15df109e2002070e66e8dfa9 /media
parente976612a6e534c1751f855270b31b842414d8ba1 (diff)
downloadframeworks_av-82016dab001142124f1ab1eba1850b5687a4f936.zip
frameworks_av-82016dab001142124f1ab1eba1850b5687a4f936.tar.gz
frameworks_av-82016dab001142124f1ab1eba1850b5687a4f936.tar.bz2
Fix buffer size issue for multichannel HE-AAC
Decoding of HE-AAC fails due to output buffer size being too small. Size output buffer size according to maximum number of channels. Change-Id: I6b10842cf7ba3da1f4b4075b1f7f5404bf76be41
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/codecs/aacdec/SoftAAC2.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
index 040a7be..a7eec57 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
@@ -27,6 +27,7 @@
#define FILEREAD_MAX_LAYERS 2
#define DRC_DEFAULT_REF_LEVEL 108 /* 108*0.25dB = -27 dB below full scale (typical for movies) */
+#define MAX_CHANNEL_COUNT 6 /* maximum number of audio channels that can be decoded */
namespace android {
@@ -87,7 +88,7 @@ void SoftAAC2::initPorts() {
def.eDir = OMX_DirOutput;
def.nBufferCountMin = kNumOutputBuffers;
def.nBufferCountActual = def.nBufferCountMin;
- def.nBufferSize = 8192 * 2;
+ def.nBufferSize = 4096 * MAX_CHANNEL_COUNT;
def.bEnabled = OMX_TRUE;
def.bPopulated = OMX_FALSE;
def.eDomain = OMX_PortDomainAudio;