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

Commit e42f027d authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Make sure the drain buffer is big enough

b/8614909

Change-Id: I9d973dcd74100b793791359c262b821207ff9ddd
parent f5c02110
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -586,9 +586,12 @@ void SoftAAC2::onPortFlushCompleted(OMX_U32 portIndex) {
}
}


void SoftAAC2::drainDecoder() {
void SoftAAC2::drainDecoder() {
    short buf [2048];
    // a buffer big enough for 6 channels of decoded HE-AAC
    aacDecoder_DecodeFrame(mAACDecoder, buf, 4096, AACDEC_FLUSH | AACDEC_CLRHIST | AACDEC_INTR);
    short buf [2048*6];
    aacDecoder_DecodeFrame(mAACDecoder, buf, 4096, AACDEC_FLUSH | AACDEC_CLRHIST | AACDEC_INTR);
    aacDecoder_DecodeFrame(mAACDecoder,
            buf, sizeof(buf), AACDEC_FLUSH | AACDEC_CLRHIST | AACDEC_INTR);
    aacDecoder_DecodeFrame(mAACDecoder,
            buf, sizeof(buf), AACDEC_FLUSH | AACDEC_CLRHIST | AACDEC_INTR);
    aacDecoder_SetParam(mAACDecoder, AAC_TPDEC_CLEAR_BUFFER, 1);
    aacDecoder_SetParam(mAACDecoder, AAC_TPDEC_CLEAR_BUFFER, 1);
    mDecoderHasData = false;
    mDecoderHasData = false;
}
}