Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 888f63bc authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

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
parent ef49e2fd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;