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

Commit a2e3cdda authored by Wonsik Kim's avatar Wonsik Kim
Browse files

CCodec: fix resource releases

PipelineWatcher holds input buffer references --- it must be
flushed to release buffers properly.

Bug: 155520767
Test: manual
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: I2ef7f266b6f91063e3f1da5019859cb3a178ec0b
parent 60215011
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1402,6 +1402,7 @@ void CCodecBufferChannel::stop() {
    if (mInputSurface != nullptr) {
        mInputSurface.reset();
    }
    mPipelineWatcher.lock()->flush();
}

void CCodecBufferChannel::reset() {
@@ -1409,6 +1410,7 @@ void CCodecBufferChannel::reset() {
    {
        Mutexed<Input>::Locked input(mInput);
        input->buffers.reset(new DummyInputBuffers(""));
        input->extraBuffers.flush();
    }
    {
        Mutexed<Output>::Locked output(mOutput);
@@ -1425,6 +1427,8 @@ void CCodecBufferChannel::release() {
        blockPools->inputPool.reset();
        blockPools->outputPoolIntf.reset();
    }
    setCrypto(nullptr);
    setDescrambler(nullptr);
}