diff options
Diffstat (limited to 'media/libstagefright/omx/OMXNodeInstance.cpp')
-rw-r--r-- | media/libstagefright/omx/OMXNodeInstance.cpp | 10 |
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); } |