summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-02-09 10:04:57 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-09 10:04:57 -0800
commitfdcba38ccf3231fb10ce649e9f985c0b44d39d92 (patch)
tree2e3b36d62fede0cee1e42f8003cae09046b3ff43 /media
parent18457fd41e7b39534e54200c1f2392da3140ec9f (diff)
parent9f4557ed0b29c85df1f2219408bad91ae4e29cbb (diff)
downloadframeworks_base-fdcba38ccf3231fb10ce649e9f985c0b44d39d92.zip
frameworks_base-fdcba38ccf3231fb10ce649e9f985c0b44d39d92.tar.gz
frameworks_base-fdcba38ccf3231fb10ce649e9f985c0b44d39d92.tar.bz2
Merge "During shutdown, don't loop forever on a state transition to OMX_StateInvalid."
Diffstat (limited to 'media')
-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);
}