diff options
-rw-r--r-- | base/src/componentbase.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/base/src/componentbase.cpp b/base/src/componentbase.cpp index e1ef01a..a9388ef 100644 --- a/base/src/componentbase.cpp +++ b/base/src/componentbase.cpp @@ -1432,16 +1432,24 @@ out: inline OMX_ERRORTYPE ComponentBase::TransStateToIdle(OMX_STATETYPE current) { - OMX_ERRORTYPE ret; + OMX_ERRORTYPE ret = OMX_ErrorNone; if (current == OMX_StateLoaded) { OMX_U32 i; for (i = 0; i < nr_ports; i++) { - if (ports[i]->IsEnabled()) - ports[i]->WaitPortBufferCompletion(); + if (ports[i]->IsEnabled()) { + if (GetWorkingRole() != NULL && + !strncmp (GetWorkingRole(),"video_decoder", 13 )) { + ret = ports[i]->WaitPortBufferCompletionTimeout(800); + } else { + ports[i]->WaitPortBufferCompletion(); + } + } } - ret = ProcessorInit(); + if (ret == OMX_ErrorNone) { + ret = ProcessorInit(); + } if (ret != OMX_ErrorNone) { LOGE("%s:%s: ProcessorInit() failed (ret : 0x%08x)\n", GetName(), GetWorkingRole(), ret); |