summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-02-17 17:53:58 -0800
committerJames Dong <jdong@google.com>2010-02-17 17:54:45 -0800
commita7d8550490e7973b12ab6aed936182ce30f882a1 (patch)
treeb79619a761904a445402665758dc4b0ac8101777
parenteea0f5bab106ef9139fb7e5e931263907e52eaa4 (diff)
downloadomap3-a7d8550490e7973b12ab6aed936182ce30f882a1.tar.gz
Fix buffer ownership and buffer count when write fails
Originally from MOT/TI Modified to add fix for the buffer count as well
-rw-r--r--omx/video/src/openmax_il/video_decode/src/OMX_VideoDec_Utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/omx/video/src/openmax_il/video_decode/src/OMX_VideoDec_Utils.c b/omx/video/src/openmax_il/video_decode/src/OMX_VideoDec_Utils.c
index 611bb2c..c6d35a1 100644
--- a/omx/video/src/openmax_il/video_decode/src/OMX_VideoDec_Utils.c
+++ b/omx/video/src/openmax_il/video_decode/src/OMX_VideoDec_Utils.c
@@ -5837,6 +5837,8 @@ OMX_ERRORTYPE VIDDEC_HandleDataBuf_FromApp(VIDDEC_COMPONENT_PRIVATE *pComponentP
ret = write(pComponentPrivate->free_inpBuf_Q[1], &pBuffHead, sizeof(pBuffHead));
if(ret == -1){
OMX_PRCOMM4(pComponentPrivate->dbg, "writing to the input pipe %x (%d)\n", OMX_ErrorInsufficientResources,ret);
+ pBufferPrivate->eBufferOwner = VIDDEC_BUFFER_WITH_DSP;
+ DecrementCount (&(pComponentPrivate->nCountInputBFromDsp), &(pComponentPrivate->mutexInputBFromDSP));
pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
pComponentPrivate->pHandle->pApplicationPrivate,
OMX_EventError,
@@ -6412,13 +6414,14 @@ OMX_ERRORTYPE VIDDEC_HandleDataBuf_FromApp(VIDDEC_COMPONENT_PRIVATE *pComponentP
ret = write(pComponentPrivate->free_inpBuf_Q[1], &pBuffHead, sizeof(pBuffHead));
if(ret == -1){
OMX_PRCOMM4(pComponentPrivate->dbg, "writing to the input pipe %x (%d)\n", OMX_ErrorInsufficientResources,ret);
+ pBufferPrivate->eBufferOwner = VIDDEC_BUFFER_WITH_DSP;
+ DecrementCount (&(pComponentPrivate->nCountInputBFromDsp), &(pComponentPrivate->mutexInputBFromDSP));
pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
pComponentPrivate->pHandle->pApplicationPrivate,
OMX_EventError,
OMX_ErrorInsufficientResources,
OMX_TI_ErrorSevere,
"Error writing to the output pipe");
- DecrementCount (&(pComponentPrivate->nCountInputBFromDsp), &(pComponentPrivate->mutexInputBFromDSP));
}
}
}