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

Commit 0e906234 authored by Rakesh Kumar's avatar Rakesh Kumar
Browse files

C2SoftAacDec: Fix reset while codec's stop()

Bug: 147348711
Test: atest android.mediav2.cts.CodecDecoderTest
Test: atest android.mediav2.cts.CodecDecoderSurfaceTest

Change-Id: I61b9cf8ed61fc3cd02068cdc696ba24e30d1ca3c
parent a4c95a85
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -289,13 +289,14 @@ c2_status_t C2SoftAacDec::onStop() {
    mOutputDelayRingBufferFilled = 0;
    mBuffersInfo.clear();

    // To make the codec behave the same before and after a reset, we need to invalidate the
    // streaminfo struct. This does that:
    mStreamInfo->sampleRate = 0; // TODO: mStreamInfo is read only

    status_t status = UNKNOWN_ERROR;
    if (mAACDecoder) {
        aacDecoder_Close(mAACDecoder);
        status = initDecoder();
    }
    mSignalledError = false;

    return C2_OK;
    return status == OK ? C2_OK : C2_CORRUPTED;
}

void C2SoftAacDec::onReset() {