From 2f62d421d6a8c44d260c1442acf316957eaf7aa3 Mon Sep 17 00:00:00 2001 From: Dan Liang Date: Fri, 28 Jun 2013 21:48:38 +0800 Subject: Add one condition check to avoid unnecessary wait in ProcessorReset BZ: 119065 When VideoEditor exports movies, it doesn't allocate output port buffers from Graphics. In case it needs to reallocate buffers, it won't wait for the invalid condition which is only signaled when working mode is GRAPHICBUFFER_MODE. Change-Id: I1faca9b8bd0cef7cb0dedb87d059bbb3c5656ce8 Signed-off-by: Dan Liang Reviewed-on: http://android.intel.com:8080/116120 Reviewed-by: cactus Reviewed-by: Gu, Wangyi Reviewed-by: Feng, Wei Reviewed-by: Shi, PingX Tested-by: Shi, PingX Reviewed-by: buildbot Tested-by: buildbot --- videocodec/OMXVideoDecoderBase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'videocodec/OMXVideoDecoderBase.cpp') diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp index 71787d4..18915e8 100755 --- a/videocodec/OMXVideoDecoderBase.cpp +++ b/videocodec/OMXVideoDecoderBase.cpp @@ -204,13 +204,13 @@ OMX_ERRORTYPE OMXVideoDecoderBase::ProcessorReset(void) { OMX_ERRORTYPE ret; VideoConfigBuffer configBuffer; pthread_mutex_lock(&mOMXBufferArray_lock); - if (!mSetNativeBuffer_completion) + if (mWorkingMode == GRAPHICBUFFER_MODE && !mSetNativeBuffer_completion) pthread_cond_wait(&mOMXBufferArray_cond, &mOMXBufferArray_lock); // reset the configbuffer and set it to mix ret = PrepareConfigBuffer(&configBuffer); + pthread_mutex_unlock(&mOMXBufferArray_lock); CHECK_RETURN_VALUE("PrepareConfigBuffer"); mVideoDecoder->reset(&configBuffer); - pthread_mutex_unlock(&mOMXBufferArray_lock); return OMX_ErrorNone; } -- cgit v1.2.3