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

Commit d5b24042 authored by Subhash Chandra Bose Naripeddy's avatar Subhash Chandra Bose Naripeddy Committed by Steve Kondik
Browse files

libstagefright: Flush the pending buffers when EOS is received

For the use case where the first frame in the buffer is EOS, decode
the aac config frame buffer to update the sample rate and channel
mode and flush out the buffer.
CRs-Fixed: 459334

Change-Id: I175dc531e00ec36a366a818366fa869cd6ccf5a1
parent 886e235d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -362,9 +362,13 @@ void SoftAAC2::onQueueFilled(OMX_U32 portIndex) {
            inInfo->mOwnedByUs = false;
            notifyEmptyBufferDone(inHeader);

            if (mDecoderHasData) {
            if (mDecoderHasData || mInputBufferCount) {
                // flush out the decoder's delayed data by calling DecodeFrame
                // one more time, with the AACDEC_FLUSH flag set

                // for the use case where the first frame in the buffer is EOS,
                // decode the header to update the sample rate and channel mode
                // and flush out the buffer.
                INT_PCM *outBuffer =
                        reinterpret_cast<INT_PCM *>(
                                outHeader->pBuffer + outHeader->nOffset);