summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-05-29 11:33:29 -0700
committerAndreas Huber <andih@google.com>2012-05-29 11:33:29 -0700
commit755b9861197f1566f916785ba7d35cf86fd5b2d5 (patch)
tree05e919c891f387aa3a038d67ed5dba212543b86d /media/libstagefright/ACodec.cpp
parent6350e21e8947398a94402bc2969d13d407fbc3fb (diff)
downloadframeworks_av-755b9861197f1566f916785ba7d35cf86fd5b2d5.zip
frameworks_av-755b9861197f1566f916785ba7d35cf86fd5b2d5.tar.gz
frameworks_av-755b9861197f1566f916785ba7d35cf86fd5b2d5.tar.bz2
Unwedge ACodec if allocating output buffers fails while reconfiguring.
Change-Id: I871cf639167c01860e65c0408d3ce935f8f8f1ea related-to-bug: 6571060
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index b2f1746..c4743a1 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -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;