video: changed the memory type about ION
[GitHub/LineageOS/android_hardware_samsung_slsi_openmax.git] / component / video / dec / Exynos_OMX_VdecControl.c
index 8569265012c0243dde2da5802da6a4f3247d2733..f1454b8c0e0c4551c2617b9e2c0ca5a9f6644278 100644 (file)
@@ -157,7 +157,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer(
     OMX_U8                *temp_buffer = NULL;
     int                    temp_buffer_fd = -1;
     OMX_U32                i = 0;
-    MEMORY_TYPE            mem_type;
+    MEMORY_TYPE            mem_type = SYSTEM_MEMORY;
 
     FunctionIn();
 
@@ -194,13 +194,14 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer(
         goto EXIT;
     }
 
-    if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && (nPortIndex == INPUT_PORT_INDEX)) {
+    if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) &&
+        (nPortIndex == INPUT_PORT_INDEX)) {
         mem_type = SECURE_MEMORY;
-    } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) {
+    } else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
+               (pExynosPort->bufferProcessType & BUFFER_SHARE)) {
         mem_type = NORMAL_MEMORY;
-    } else {
-        mem_type = SYSTEM_MEMORY;
     }
+
     temp_buffer = Exynos_OSAL_SharedMemory_Alloc(pVideoDec->hSharedMemory, nSizeBytes, mem_type);
     if (temp_buffer == NULL) {
         ret = OMX_ErrorInsufficientResources;