removed unused codes
[platform/adaptation/ap_samsung/libomxil-e3250-v4l2.git] / exynos4 / libcodec / video / v4l2 / enc / ExynosVideoEncoder.c
index 2851560..925b9b3 100755 (executable)
@@ -134,7 +134,6 @@ static unsigned int __ColorFormatType_To_V4L2PixelFormat(ExynosVideoColorFormatT
 static void *MFC_Encoder_Init(int nMemoryType)
 {
     ExynosVideoEncContext *pCtx     = NULL;
-    pthread_mutex_t       *pMutex   = NULL;
     int needCaps = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING);
 
     pCtx = (ExynosVideoEncContext *)malloc(sizeof(*pCtx));
@@ -161,27 +160,23 @@ static void *MFC_Encoder_Init(int nMemoryType)
 
     pCtx->nMemoryType = nMemoryType;
 
-    pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-    if (pMutex == NULL) {
+    pCtx->pInMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
+    if (pCtx->pInMutex == NULL) {
         ALOGE("%s: Failed to allocate mutex about input buffer", __func__);
         goto EXIT_QUERYCAP_FAIL;
     }
-    if (pthread_mutex_init(pMutex, NULL) != 0) {
-        free(pMutex);
+    if (pthread_mutex_init(pCtx->pInMutex, NULL) != 0) {
         goto EXIT_QUERYCAP_FAIL;
     }
-    pCtx->pInMutex = (void*)pMutex;
 
-    pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-    if (pMutex == NULL) {
+    pCtx->pOutMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
+    if (pCtx->pOutMutex == NULL) {
         ALOGE("%s: Failed to allocate mutex about output buffer", __func__);
         goto EXIT_QUERYCAP_FAIL;
     }
-    if (pthread_mutex_init(pMutex, NULL) != 0) {
-        free(pMutex);
+    if (pthread_mutex_init(pCtx->pOutMutex, NULL) != 0) {
         goto EXIT_QUERYCAP_FAIL;
     }
-    pCtx->pOutMutex = (void*)pMutex;
 
     return (void *)pCtx;