aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/src/portbase.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/base/src/portbase.cpp b/base/src/portbase.cpp
index 228cb84..a0b7654 100644
--- a/base/src/portbase.cpp
+++ b/base/src/portbase.cpp
@@ -956,8 +956,12 @@ OMX_ERRORTYPE PortBase::TransState(OMX_U8 transition)
portdefinition.bEnabled = OMX_TRUE;
}
else if(transition == OMX_PortDisabled) {
- FlushPort();
- WaitPortBufferCompletion();
+ /*need to flush only if port is not empty*/
+ if (nr_buffer_hdrs)
+ {
+ FlushPort();
+ WaitPortBufferCompletion();
+ }
portdefinition.bEnabled = OMX_FALSE;
}
else {