From 82016dab001142124f1ab1eba1850b5687a4f936 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Sun, 9 Sep 2012 10:27:08 -0700 Subject: 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 --- media/libstagefright/codecs/aacdec/SoftAAC2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'media') 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; -- cgit v1.1