From 7b2b4529654ddaca08af117e1684b59b7c9bd34c Mon Sep 17 00:00:00 2001 From: Ethan Chen Date: Tue, 11 Aug 2015 18:18:47 -0700 Subject: [PATCH] osal: Fix OSAL lock ANB type casting * commit 9d7f3c9550db35b835be9ca679befbca171c0333 picked the original change incorrectly resulting in the useAndroidNativeBuffer function passing a pBuffer into a function expecting a buffer_handle_t. This would cause CSC to crash when converting video frames. Change-Id: Ia0270d93558f682d64d830643aba43295414dba1 --- osal/Exynos_OSAL_Android.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osal/Exynos_OSAL_Android.cpp b/osal/Exynos_OSAL_Android.cpp index 8a8a86c..9b7ec6a 100644 --- a/osal/Exynos_OSAL_Android.cpp +++ b/osal/Exynos_OSAL_Android.cpp @@ -220,12 +220,11 @@ OMX_ERRORTYPE useAndroidNativeBuffer( for (i = 0; i < pExynosPort->portDefinition.nBufferCountActual; i++) { if (pExynosPort->bufferStateAllocate[i] == BUFFER_STATE_FREE) { - OMX_U32 stride; - pExynosPort->extendBufferHeader[i].OMXBufferHeader = temp_bufferHeader; pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ASSIGNED | HEADER_STATE_ALLOCATED); INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE); - temp_bufferHeader->pBuffer = pBuffer; + android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer; + temp_bufferHeader->pBuffer = (OMX_U8 *)pANB->handle; temp_bufferHeader->nAllocLen = nSizeBytes; temp_bufferHeader->pAppPrivate = pAppPrivate; if (nPortIndex == INPUT_PORT_INDEX) -- 2.20.1