common: Added a bufferQ cleaning routine
authorTaehwan Kim <t_h.kim@samsung.com>
Mon, 29 Oct 2012 04:13:59 +0000 (13:13 +0900)
committerHuisung Kang <hs1218.kang@samsung.com>
Mon, 29 Oct 2012 04:54:22 +0000 (13:54 +0900)
When changing to Loaded from Idle,
does not clean a bufferQ at each port.

Then, possible to access old infomation
in input or output buffer getQueue function.

Change-Id: I574f9783abaaf9def7413588e2e3341602cdcc70
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
component/common/Exynos_OMX_Basecomponent.c

index 8f1c1850c7f56dc923ffb456bd32de730734f181..aeb92d52c57fee4bca0c9da8af3a1d59cbe6bc7d 100644 (file)
@@ -308,6 +308,11 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX
                 } else {
                     if (CHECK_PORT_ENABLED(pExynosPort)) {
                         Exynos_OSAL_SemaphoreWait(pExynosPort->unloadedResource);
+                        while (Exynos_OSAL_GetElemNum(&pExynosPort->bufferQ) > 0) {
+                            message = (EXYNOS_OMX_MESSAGE *)Exynos_OSAL_Dequeue(&pExynosPort->bufferQ);
+                            if (message != NULL)
+                                Exynos_OSAL_Free(message);
+                        }
                         pExynosPort->portDefinition.bPopulated = OMX_FALSE;
                     }
                 }