diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2012-09-09 10:27:08 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2012-09-09 10:27:08 -0700 |
commit | 888f63bcde37347061de1aabb1b7febb2eca0875 (patch) | |
tree | 59645401a47396ab08c57cf868b07cd18e65f327 /media | |
parent | ef49e2fdb1f776229a4be05aa9952a1107e94f51 (diff) | |
download | frameworks_av-888f63bcde37347061de1aabb1b7febb2eca0875.zip frameworks_av-888f63bcde37347061de1aabb1b7febb2eca0875.tar.gz frameworks_av-888f63bcde37347061de1aabb1b7febb2eca0875.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.cpp | 3 |
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; |