openmax: Dequeue API changes for I/O error handling
[GitHub/LineageOS/android_hardware_samsung_slsi_openmax.git] / component / video / dec / h264 / Exynos_OMX_H264dec.c
index 4d7e1f3f975e9574bb9c14f2b9a8e45b6733d1dc..4afc1dec1e48b022edd07d744d2b79a9c2723d9c 100644 (file)
@@ -2004,7 +2004,14 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
     }
 
     while (1) {
-        if ((pVideoBuffer = pOutbufOps->Dequeue(hMFCHandle)) == NULL) {
+        pVideoBuffer = pOutbufOps->Dequeue(hMFCHandle);
+        if (pVideoBuffer == (ExynosVideoBuffer *)VIDEO_ERROR_DQBUF_EIO) {
+            Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "HW is not available");
+            ret = OMX_ErrorHardware;
+            goto EXIT;
+        }
+
+        if (pVideoBuffer == NULL) {
             ret = OMX_ErrorNone;
             goto EXIT;
         }