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

Commit 810eace3 authored by Sungtak Lee's avatar Sungtak Lee
Browse files

Codec2 Components: reset OutputBlockPool after use

Since SimpleC2Component is holding the reference of output BlockPool,
destroying output BlockPool and creating a new BlockPool does not work.

Reset the reference of output BlockPool after
use(reset()/stop()/release()).

Bug: 184049126
Test: atest CtsMediaTestCases:android.media.cts.AdaptivePlaybackTest
Change-Id: I75fe1555533d75aa0f742e59992ae033f4454160
parent c293b926
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -110,17 +110,20 @@ void SimpleC2Component::WorkHandler::onMessageReceived(const sp<AMessage> &msg)
        }
        case kWhatStop: {
            int32_t err = thiz->onStop();
            thiz->mOutputBlockPool.reset();
            Reply(msg, &err);
            break;
        }
        case kWhatReset: {
            thiz->onReset();
            thiz->mOutputBlockPool.reset();
            mRunning = false;
            Reply(msg);
            break;
        }
        case kWhatRelease: {
            thiz->onRelease();
            thiz->mOutputBlockPool.reset();
            mRunning = false;
            Reply(msg);
            break;