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

Commit fb128ba8 authored by Sungtak Lee's avatar Sungtak Lee
Browse files

Release buffers on MediaCodec#stop()

Release all buffers on Codec2 stop() in order to quick release in case
of using multiple Codec's from application.

Bug: 146679370
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: I7a025c2d349442f93dbfab0bd1892df46229ef56
parent 7e381341
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1406,6 +1406,9 @@ void CCodec::stop() {
        // TODO: convert err into status_t
        mCallback->onError(UNKNOWN_ERROR, ACTION_CODE_FATAL);
    }
    // Assure buffers are not owned when stop() was called without flush().
    std::list<std::unique_ptr<C2Work>> flushedWork;
    mChannel->flush(flushedWork);

    {
        Mutexed<std::unique_ptr<Config>>::Locked configLocked(mConfig);