mm-video-v4l2: vdec: udpate error based on return value
when set format ioctl fails, check for return error value
and update the correct error.
Change-Id: I0bbacaac440f88a82a318f876228715f25e106e3
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
index 4eb9ea9..cf2d0e5 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -4287,7 +4287,7 @@
ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
if (ret) {
DEBUG_PRINT_ERROR("Set Resolution failed");
- eRet = OMX_ErrorUnsupportedSetting;
+ eRet = errno == EBUSY ? OMX_ErrorInsufficientResources : OMX_ErrorUnsupportedSetting;
} else
eRet = get_buffer_req(&drv_ctx.op_buf);
}
@@ -4429,7 +4429,7 @@
}
if (ret) {
DEBUG_PRINT_ERROR("Set Resolution failed");
- eRet = OMX_ErrorUnsupportedSetting;
+ eRet = errno == EBUSY ? OMX_ErrorInsufficientResources : OMX_ErrorUnsupportedSetting;
} else {
if (!is_down_scalar_enabled)
eRet = get_buffer_req(&drv_ctx.op_buf);
@@ -5528,7 +5528,7 @@
}
if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- ret = errno == -EBUSY ? OMX_ErrorInsufficientResources :
+ ret = errno == EBUSY ? OMX_ErrorInsufficientResources :
OMX_ErrorUnsupportedSetting;
DEBUG_PRINT_ERROR("Failed to set operating rate %u fps (%s)",
rate->nU32 >> 16, errno == -EBUSY ? "HW Overload" : strerror(errno));