summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Huber <andih@google.com> 2010-02-08 12:54:40 -0800
committer Andreas Huber <andih@google.com> 2010-02-08 12:54:40 -0800
commit9f4557ed0b29c85df1f2219408bad91ae4e29cbb (patch)
treef5d1267589e3b7cb9c5161c15f96ab4272d23aaf
parent5d36c46d2d8fb3f1bdc8fd1ff407e14b4433272a (diff)
During shutdown, don't loop forever on a state transition to OMX_StateInvalid.
related-to-bug: 2420917
-rw-r--r--media/libstagefright/omx/OMXNodeInstance.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index 70c6a58c948a..2458d2a9336a 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -129,11 +129,16 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) {
sendCommand(OMX_CommandStateSet, OMX_StateIdle);
OMX_ERRORTYPE err;
while ((err = OMX_GetState(mHandle, &state)) == OMX_ErrorNone
- && state != OMX_StateIdle) {
+ && state != OMX_StateIdle
+ && state != OMX_StateInvalid) {
usleep(100000);
}
CHECK_EQ(err, OMX_ErrorNone);
+ if (state == OMX_StateInvalid) {
+ break;
+ }
+
// fall through
}
@@ -146,7 +151,8 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) {
OMX_ERRORTYPE err;
while ((err = OMX_GetState(mHandle, &state)) == OMX_ErrorNone
- && state != OMX_StateLoaded) {
+ && state != OMX_StateLoaded
+ && state != OMX_StateInvalid) {
LOGV("waiting for Loaded state...");
usleep(100000);
}