From: SeungBeom Kim Date: Mon, 1 Sep 2014 02:00:58 +0000 (+0900) Subject: remove misleading error messages: free only allocated ion buffers on exit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88c954f6;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos5.git remove misleading error messages: free only allocated ion buffers on exit Fixed of print error message that occurs at the end of the video play. ex) E/ion(130): ioctl c0044901 failed with code -1: Invalid argument Bug: 17720260 Change-Id: Ib823b8d5e9bf80a07917d17379d5e6d6022e8a66 Signed-off-by: SeungBeom Kim --- diff --git a/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp b/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp index fb64735..997b926 100644 --- a/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp +++ b/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp @@ -420,9 +420,12 @@ OMX_ERRORTYPE Exynos_OSAL_RefANB_Decrease(OMX_HANDLETYPE hREF, OMX_U32 BufferFd) for (i = 0; i < MAX_BUFFER_REF; i++) { if (phREF->SharedBuffer[i].BufferFd == BufferFd) { - ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle); - ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle1); - ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle2); + if (phREF->SharedBuffer[i].BufferFd > -1) + ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle); + if (phREF->SharedBuffer[i].BufferFd1 > -1) + ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle1); + if (phREF->SharedBuffer[i].BufferFd2 > -1) + ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle2); phREF->SharedBuffer[i].cnt--; if (phREF->SharedBuffer[i].cnt == 0) { phREF->SharedBuffer[i].BufferFd = -1;