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

Commit 755b9861 authored by Andreas Huber's avatar Andreas Huber
Browse files

Unwedge ACodec if allocating output buffers fails while reconfiguring.

Change-Id: I871cf639167c01860e65c0408d3ce935f8f8f1ea
related-to-bug: 6571060
parent 6350e21e
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -3472,11 +3472,14 @@ bool ACodec::OutputPortSettingsChangedState::onOMXEvent(

                    mCodec->signalError(OMX_ErrorUndefined, err);

                    // This is technically not correct, since we were unable
                    // to allocate output buffers and therefore the output port
                    // remains disabled. It is necessary however to allow us
                    // to shutdown the codec properly.
                    mCodec->changeState(mCodec->mExecutingState);
                    // This is technically not correct, but appears to be
                    // the only way to free the component instance.
                    // Controlled transitioning from excecuting->idle
                    // and idle->loaded seem impossible probably because
                    // the output port never finishes re-enabling.
                    mCodec->mShutdownInProgress = true;
                    mCodec->mKeepComponentAllocated = false;
                    mCodec->changeState(mCodec->mLoadedState);
                }

                return true;