Merge "Fixed a problem where a variable is not set before its value is used."
diff --git a/omx/video/src/openmax_il/video_decode/src/OMX_VideoDecoder.c b/omx/video/src/openmax_il/video_decode/src/OMX_VideoDecoder.c
index a9314ec..6b913b5 100644
--- a/omx/video/src/openmax_il/video_decode/src/OMX_VideoDecoder.c
+++ b/omx/video/src/openmax_il/video_decode/src/OMX_VideoDecoder.c
@@ -2330,8 +2330,10 @@
            }
            else if(ret == ETIMEDOUT) {
               /* Unlock mutex in case of timeout */
+              OMX_ERROR4(pComponentPrivate->dbg, "VIDDEC_GetState timed out\n");
               pthread_mutex_unlock(&pComponentPrivate->mutexStateChangeRequest);
-              return OMX_ErrorTimeout;
+              *pState = OMX_StateInvalid;
+              return OMX_ErrorNone;
            }
         }
      }
diff --git a/omx/video/src/openmax_il/video_encode/src/OMX_VideoEnc_Utils.c b/omx/video/src/openmax_il/video_encode/src/OMX_VideoEnc_Utils.c
index cf7d74d..570a858 100644
--- a/omx/video/src/openmax_il/video_encode/src/OMX_VideoEnc_Utils.c
+++ b/omx/video/src/openmax_il/video_encode/src/OMX_VideoEnc_Utils.c
@@ -3390,7 +3390,7 @@
         pCreatePhaseArgs->ulFrameRate > 15000)
     {
         pComponentPrivate->maxMVperMB = 1;
-        pComponentPrivate->intra4x4EnableIdc = INTRA4x4_NONE;
+        pComponentPrivate->intra4x4EnableIdc = INTRA4x4_ISLICES;
         pComponentPrivate->nIntraFrameInterval = 30;
         pComponentPrivate->nAIRRate = 0;
         /* Encoding preset = 4 enables DSP side optimizations for high resolutions */
@@ -3398,8 +3398,6 @@
         pCreatePhaseArgs->ulIntraFramePeriod = 0;
         /* Constant bit rate control enabled */
         pCreatePhaseArgs->ucRateControlAlgorithm = 1;
-        /* Disable deblocking */
-        pCreatePhaseArgs->ucDeblockingEnable  = 0;
         pCreatePhaseArgs->ucLevel = 30;
     }
     /* Ensure frame rate update interval, which forces IDR frames, is same as I-Slice interval */
diff --git a/omx/video/src/openmax_il/video_encode/src/OMX_VideoEncoder.c b/omx/video/src/openmax_il/video_encode/src/OMX_VideoEncoder.c
index 3cd8c79..ecf6c17 100644
--- a/omx/video/src/openmax_il/video_encode/src/OMX_VideoEncoder.c
+++ b/omx/video/src/openmax_il/video_encode/src/OMX_VideoEncoder.c
@@ -2736,8 +2736,10 @@
            }
            else if(ret == ETIMEDOUT) {
               /* Unlock mutex in case of timeout */
+              OMX_ERROR4(pComponentPrivate->dbg, "GetState timed out\n");
               pthread_mutex_unlock(&pComponentPrivate->mutexStateChangeRequest);
-              return OMX_ErrorTimeout;
+              *pState = OMX_StateInvalid;
+              return OMX_ErrorNone;
            }
         }
     }