summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-02-08 12:54:40 -0800
committerAndreas Huber <andih@google.com>2010-02-08 12:54:40 -0800
commit0d681df3b0ded2c1e335b6b5785439da4ce2c238 (patch)
tree563a8491ef4cfeb3e36cf06530c269d7d1ddccd2 /media/libstagefright/omx
parent7ebf475799f6ae1ec8c67983fc1028c487af4c2e (diff)
downloadframeworks_av-0d681df3b0ded2c1e335b6b5785439da4ce2c238.zip
frameworks_av-0d681df3b0ded2c1e335b6b5785439da4ce2c238.tar.gz
frameworks_av-0d681df3b0ded2c1e335b6b5785439da4ce2c238.tar.bz2
During shutdown, don't loop forever on a state transition to OMX_StateInvalid.
related-to-bug: 2420917
Diffstat (limited to 'media/libstagefright/omx')
-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 70c6a58..2458d2a 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);
}