mm-audio: omx: add 64 bit support

-Changes to support omx encoders on 64 bit platform

Change-Id: I05749f619efaf66e107b1438635a38f92a11b523
diff --git a/mm-audio/aenc-aac/Android.mk b/mm-audio/aenc-aac/Android.mk
index 7cd804a..cb582ff 100644
--- a/mm-audio/aenc-aac/Android.mk
+++ b/mm-audio/aenc-aac/Android.mk
@@ -1,4 +1,4 @@
-ifeq ($(TARGET_ARCH),arm)
+ifneq ($(filter arm aarch64 arm64, $(TARGET_ARCH)),)
 
 
 AENC_AAC_PATH:= $(call my-dir)
@@ -27,5 +27,8 @@
 ifeq ($(call is-board-platform,msm8916),true)
 include $(AENC_AAC_PATH)/qdsp6/Android.mk
 endif
+ifeq ($(call is-board-platform,msm8994),true)
+include $(AENC_AAC_PATH)/qdsp6/Android.mk
+endif
 
 endif
diff --git a/mm-audio/aenc-aac/qdsp6/Android.mk b/mm-audio/aenc-aac/qdsp6/Android.mk
index e339f5d..ac9e0cc 100644
--- a/mm-audio/aenc-aac/qdsp6/Android.mk
+++ b/mm-audio/aenc-aac/qdsp6/Android.mk
@@ -13,6 +13,7 @@
 libOmxAacEnc-def += -D_ENABLE_QC_MSG_LOG_
 libOmxAacEnc-def += -DVERBOSE
 libOmxAacEnc-def += -D_DEBUG
+libOmxAacEnc-def += -Wconversion
 ifeq ($(strip $(TARGET_USES_QCOM_MM_AUDIO)),true)
 libOmxAacEnc-def += -DAUDIOV2
 endif
diff --git a/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h b/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h
index 623caa8..f3d9547 100644
--- a/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h
+++ b/mm-audio/aenc-aac/qdsp6/inc/omx_aac_aenc.h
@@ -81,10 +81,10 @@
 
 
 #define PrintFrameHdr(i,bufHdr) \
-                           DEBUG_PRINT("i=%d OMX bufHdr[%x]buf[%x]size[%d]TS[%lld]nFlags[0x%x]\n",\
+                           DEBUG_PRINT("i=%d OMX bufHdr[%p]buf[%p]size[%d]TS[%lld]nFlags[0x%x]\n",\
                            i,\
-                           (unsigned) bufHdr,                                     \
-                           (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
+                           bufHdr,                                     \
+                           ((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFilledLen,\
                            ((OMX_BUFFERHEADERTYPE *)bufHdr)->nTimeStamp, \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFlags)
@@ -314,7 +314,7 @@
                                 void *                  eglImage);
 
     bool post_command(unsigned int p1, unsigned int p2,
-        unsigned int id);
+        unsigned char id);
 
     // Deferred callback identifiers
     enum
@@ -376,9 +376,9 @@
 
     struct omx_event
     {
-        unsigned param1;
-        unsigned param2;
-        unsigned id;
+        unsigned long param1;
+        unsigned long param2;
+        unsigned char id;
     };
 
     struct omx_cmd_queue
@@ -390,16 +390,16 @@
 
         omx_cmd_queue();
         ~omx_cmd_queue();
-        bool insert_entry(unsigned p1, unsigned p2, unsigned id);
-        bool pop_entry(unsigned *p1,unsigned *p2, unsigned *id);
-        bool get_msg_id(unsigned *id);
+        bool insert_entry(unsigned long p1, unsigned long p2, unsigned char id);
+        bool pop_entry(unsigned long *p1,unsigned long *p2, unsigned char *id);
+        bool get_msg_id(unsigned char *id);
         bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned id);
     };
 
     typedef struct TIMESTAMP
     {
-        unsigned long LowPart;
-        unsigned long HighPart;
+        unsigned int LowPart;
+        unsigned int HighPart;
     }__attribute__((packed)) TIMESTAMP;
 
     typedef struct metadata_input
@@ -423,7 +423,7 @@
     {
         OMX_U32 tot_in_buf_len;
         OMX_U32 tot_out_buf_len;
-        OMX_U32 tot_pb_time;
+        OMX_TICKS tot_pb_time;
         OMX_U32 fbd_cnt;
         OMX_U32 ftb_cnt;
         OMX_U32 etb_cnt;
@@ -588,11 +588,11 @@
 
     bool search_output_bufhdr(OMX_BUFFERHEADERTYPE *buffer);
 
-    bool post_input(unsigned int p1, unsigned int p2,
-                    unsigned int id);
+    bool post_input(unsigned long p1, unsigned long p2,
+                    unsigned char id);
 
-    bool post_output(unsigned int p1, unsigned int p2,
-                     unsigned int id);
+    bool post_output(unsigned long p1, unsigned long p2,
+                     unsigned char id);
 
     void process_events(omx_aac_aenc *client_data);
 
diff --git a/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp b/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
index 6521265..c918268 100644
--- a/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
+++ b/mm-audio/aenc-aac/qdsp6/src/omx_aac_aenc.cpp
@@ -58,9 +58,9 @@
 }
 
 // omx cmd queue insert
-bool omx_aac_aenc::omx_cmd_queue::insert_entry(unsigned p1,
-                                                unsigned p2,
-                                                unsigned id)
+bool omx_aac_aenc::omx_cmd_queue::insert_entry(unsigned long p1,
+                                                unsigned long p2,
+                                                unsigned char id)
 {
     bool ret = true;
     if (m_size < OMX_CORE_CONTROL_CMDQ_SIZE)
@@ -82,8 +82,8 @@
     return ret;
 }
 
-bool omx_aac_aenc::omx_cmd_queue::pop_entry(unsigned *p1,
-                                             unsigned *p2, unsigned *id)
+bool omx_aac_aenc::omx_cmd_queue::pop_entry(unsigned long *p1,
+                                             unsigned long *p2, unsigned char *id)
 {
     bool ret = true;
     if (m_size > 0)
@@ -112,7 +112,7 @@
 {
     return(new omx_aac_aenc);
 }
-bool omx_aac_aenc::omx_cmd_queue::get_msg_id(unsigned *id)
+bool omx_aac_aenc::omx_cmd_queue::get_msg_id(unsigned char *id)
 {
    if(m_size > 0)
    {
@@ -260,6 +260,7 @@
         adif_flag(0),
         mp4ff_flag(0),
         m_app_data(NULL),
+        nNumOutputBuf(0),
         m_drv_fd(-1),
         bFlushinprogress(0),
         is_in_th_sleep(false),
@@ -272,8 +273,9 @@
         m_out_act_buf_count (OMX_CORE_NUM_OUTPUT_BUFFERS),
         m_inp_current_buf_count(0),
         m_out_current_buf_count(0),
-        output_buffer_size(OMX_AAC_OUTPUT_BUFFER_SIZE),
+        output_buffer_size((OMX_U32)OMX_AAC_OUTPUT_BUFFER_SIZE),
         input_buffer_size(OMX_CORE_INPUT_BUFFER_SIZE),
+        m_session_id(0),
         m_inp_bEnabled(OMX_TRUE),
         m_out_bEnabled(OMX_TRUE),
         m_inp_bPopulated(OMX_FALSE),
@@ -282,9 +284,7 @@
         m_state(OMX_StateInvalid),
         m_ipc_to_in_th(NULL),
         m_ipc_to_out_th(NULL),
-        m_ipc_to_cmd_th(NULL),
-        nNumOutputBuf(0),
-        m_session_id(0)
+        m_ipc_to_cmd_th(NULL)
 {
     int cond_ret = 0;
     component_Role.nSize = 0;
@@ -505,13 +505,13 @@
         m_aac_pb_stats.fbd_cnt++;
         pthread_mutex_lock(&out_buf_count_lock);
         nNumOutputBuf--;
-        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%lu fbd_cnt=%lu\n",\
+        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%u fbd_cnt=%u\n",\
                     nNumOutputBuf,
                     m_aac_pb_stats.tot_out_buf_len,
                     m_aac_pb_stats.fbd_cnt);
         m_aac_pb_stats.tot_out_buf_len += bufHdr->nFilledLen;
         m_aac_pb_stats.tot_pb_time     = bufHdr->nTimeStamp;
-        DEBUG_PRINT("FBD:in_buf_len=%lu out_buf_len=%lu\n",
+        DEBUG_PRINT("FBD:in_buf_len=%u out_buf_len=%u\n",
                     m_aac_pb_stats.tot_in_buf_len,
                     m_aac_pb_stats.tot_out_buf_len);
         pthread_mutex_unlock(&out_buf_count_lock);
@@ -544,9 +544,9 @@
 =============================================================================*/
 void omx_aac_aenc::process_out_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;                 // qsize
     unsigned      tot_qsize = 0;
     omx_aac_aenc  *pThis    = (omx_aac_aenc *) client_data;
@@ -749,9 +749,9 @@
 =============================================================================*/
 void omx_aac_aenc::process_command_msg(void *client_data, unsigned char id)
 {
-    unsigned     p1;                             // Parameter - 1
-    unsigned     p2;                             // Parameter - 2
-    unsigned     ident;
+    unsigned long p1 = 0;                             // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned     qsize  = 0;
     omx_aac_aenc *pThis = (omx_aac_aenc*)client_data;
     pthread_mutex_lock(&pThis->m_commandlock);
@@ -823,15 +823,15 @@
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventError,
-                                         p2,
-                                         NULL,
-                                         NULL );
+                                         (OMX_U32)p2,
+                                         0,
+                                         0);
             } else
             {
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventCmdComplete,
-                                         p1, p2, NULL );
+                                         (OMX_U32)p1, (OMX_U32)p2, NULL );
             }
         } else
         {
@@ -879,9 +879,9 @@
 =============================================================================*/
 void omx_aac_aenc::process_in_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;
     unsigned      tot_qsize = 0;
     omx_aac_aenc  *pThis    = (omx_aac_aenc *) client_data;
@@ -1059,14 +1059,14 @@
     randomly assign the value right now. Query will result in
     incorrect param */
     memset(&m_aac_param, 0, sizeof(m_aac_param));
-    m_aac_param.nSize = sizeof(m_aac_param);
+    m_aac_param.nSize = (OMX_U32)sizeof(m_aac_param);
     m_aac_param.nChannels = DEFAULT_CH_CFG;
     m_aac_param.nSampleRate = DEFAULT_SF;
     m_aac_param.nBitRate = DEFAULT_BITRATE;
     m_volume = OMX_AAC_DEFAULT_VOL;             /* Close to unity gain */
     memset(&m_aac_pb_stats,0,sizeof(AAC_PB_STATS));
     memset(&m_pcm_param, 0, sizeof(m_pcm_param));
-    m_pcm_param.nSize = sizeof(m_pcm_param);
+    m_pcm_param.nSize = (OMX_U32)sizeof(m_pcm_param);
     m_pcm_param.nChannels = DEFAULT_CH_CFG;
     m_pcm_param.nSamplingRate = DEFAULT_SF;
 
@@ -1099,20 +1099,20 @@
     if (!strcmp(role,"OMX.qcom.audio.encoder.aac"))
     {
         pcm_input = 1;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole, (const char*)role,
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else if (!strcmp(role,"OMX.qcom.audio.encoder.tunneled.aac"))
     {
         pcm_input = 0;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole, (const char*)role,
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else
     {
-        component_Role.nSize = sizeof("\0");
+        component_Role.nSize = (OMX_U32)sizeof("\0");
         strlcpy((char *)component_Role.cRole, (const char*)"\0",
 		sizeof(component_Role.cRole));
         DEBUG_PRINT_ERROR("\ncomponent_init: Component %s LOADED is invalid\n",
@@ -1256,7 +1256,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1270,7 +1270,7 @@
     }
     post_command((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
     DEBUG_PRINT("Send Command : returns with OMX_ErrorNone \n");
-    DEBUG_PRINT("send_command : recieved state before semwait= %lu\n",param1);
+    DEBUG_PRINT("send_command : recieved state before semwait= %u\n",param1);
     sem_wait (&sem_States);
     DEBUG_PRINT("send_command : recieved state after semwait\n");
     return OMX_ErrorNone;
@@ -1300,7 +1300,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1440,7 +1440,7 @@
                 drv_aac_enc_config.sample_rate = m_aac_param.nSampleRate;
                 drv_aac_enc_config.bit_rate =
                 get_updated_bit_rate(m_aac_param.nBitRate);
-                DEBUG_PRINT("aac config %lu,%lu,%lu %d updated bitrate %d\n",
+                DEBUG_PRINT("aac config %u,%u,%u %d updated bitrate %d\n",
                             m_aac_param.nChannels,m_aac_param.nSampleRate,
 			    m_aac_param.nBitRate,m_aac_param.eAACStreamFormat,
                             drv_aac_enc_config.bit_rate);
@@ -1546,7 +1546,7 @@
                     pcm_cfg.sample_rate  =  m_pcm_param.nSamplingRate;
                     pcm_cfg.buffer_size =  input_buffer_size;
                     pcm_cfg.buffer_count =  m_inp_current_buf_count;
-                    DEBUG_PRINT("pcm config %lu %lu\n",m_pcm_param.nChannels,
+                    DEBUG_PRINT("pcm config %u %u\n",m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
 
                     if (ioctl(m_drv_fd, AUDIO_SET_CONFIG, &pcm_cfg) == -1)
@@ -1809,7 +1809,7 @@
     } else if (OMX_CommandFlush == cmd)
     {
         DEBUG_DETAIL("*************************\n");
-        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%lu\n",param1);
+        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%u\n",param1);
         DEBUG_DETAIL("*************************\n");
         bFlag = 0;
         if ( param1 == OMX_CORE_INPUT_PORT_INDEX ||
@@ -1848,7 +1848,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable in "\
-                                " param1=%lu m_state=%d \n",param1, m_state);
+                                " param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 DEBUG_PRINT("send_command_proxy:OMX_CommandPortDisable:\
@@ -1880,7 +1880,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable out "\
-                                "param1=%lu m_state=%d \n",param1, m_state);
+                                "param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 BITMASK_SET(&m_flags, OMX_COMPONENT_OUTPUT_DISABLE_PENDING);
@@ -1997,7 +1997,7 @@
 {
     bool bRet = true;
 
-    DEBUG_PRINT("Execute_omx_flush Port[%lu]", param1);
+    DEBUG_PRINT("Execute_omx_flush Port[%u]", param1);
     struct timespec abs_timeout;
     abs_timeout.tv_sec = 1;
     abs_timeout.tv_nsec = 0;
@@ -2046,7 +2046,7 @@
         DEBUG_DETAIL("WAITING FOR FLUSH ACK's param1=%d",param1);
         wait_for_event();
 
-        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%lu cmd_cmpl=%d",\
+        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%u cmd_cmpl=%d",\
                     param1,cmd_cmpl);
 
         // If not going to idle state, Send FLUSH complete message 
@@ -2160,7 +2160,7 @@
         DEBUG_DETAIL("RECIEVED FLUSH ACK FOR O/P PORT param1=%d",param1);
     } else
     {
-        DEBUG_PRINT("Invalid Port ID[%lu]",param1);
+        DEBUG_PRINT("Invalid Port ID[%u]",param1);
     }
     return bRet;
 }
@@ -2188,9 +2188,9 @@
 bool omx_aac_aenc::execute_input_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2268,9 +2268,9 @@
 bool omx_aac_aenc::execute_output_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2351,9 +2351,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_aac_aenc::post_input(unsigned int p1,
-                               unsigned int p2,
-                               unsigned int id)
+bool omx_aac_aenc::post_input(unsigned long p1,
+                               unsigned long p2,
+                               unsigned char id)
 {
     bool bRet = false;
     pthread_mutex_lock(&m_lock);
@@ -2414,7 +2414,7 @@
 =============================================================================*/
 bool omx_aac_aenc::post_command(unsigned int p1,
                                  unsigned int p2,
-                                 unsigned int id)
+                                 unsigned char id)
 {
     bool bRet  = false;
 
@@ -2461,9 +2461,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_aac_aenc::post_output(unsigned int p1,
-                                unsigned int p2,
-                                unsigned int id)
+bool omx_aac_aenc::post_output(unsigned long p1,
+                                unsigned long p2,
+                                unsigned char id)
 {
     bool bRet = false;
 
@@ -2527,7 +2527,7 @@
         return OMX_ErrorBadParameter;
     }
 
-    switch (paramIndex)
+    switch ((int)paramIndex)
     {
         case OMX_IndexParamPortDefinition:
             {
@@ -2535,11 +2535,11 @@
                 portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
 
                 DEBUG_PRINT("OMX_IndexParamPortDefinition " \
-                            "portDefn->nPortIndex = %lu\n",
+                            "portDefn->nPortIndex = %u\n",
 				portDefn->nPortIndex);
 
                 portDefn->nVersion.nVersion = OMX_SPEC_VERSION;
-                portDefn->nSize = sizeof(portDefn);
+                portDefn->nSize = (OMX_U32)sizeof(portDefn);
                 portDefn->eDomain    = OMX_PortDomainAudio;
 
                 if (0 == portDefn->nPortIndex)
@@ -2581,7 +2581,7 @@
                 DEBUG_PRINT("OMX_IndexParamAudioInit\n");
 
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 2;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2593,7 +2593,7 @@
                 (OMX_AUDIO_PARAM_PORTFORMATTYPE *) paramData;
                 DEBUG_PRINT("OMX_IndexParamAudioPortFormat\n");
                 portFormatType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portFormatType->nSize = sizeof(portFormatType);
+                portFormatType->nSize = (OMX_U32)sizeof(portFormatType);
 
                 if (OMX_CORE_INPUT_PORT_INDEX == portFormatType->nPortIndex)
                 {
@@ -2603,7 +2603,7 @@
 				portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("get_parameter: OMX_IndexParamAudioFormat: "\
-                                "%lu\n", portFormatType->nIndex);
+                                "%u\n", portFormatType->nIndex);
 
                     portFormatType->eEncoding = OMX_AUDIO_CodingAAC;
                 } else
@@ -2638,7 +2638,7 @@
     {
        QOMX_AUDIO_STREAM_INFO_DATA *streaminfoparam =
                (QOMX_AUDIO_STREAM_INFO_DATA *) paramData;
-       streaminfoparam->sessionId = m_session_id;
+       streaminfoparam->sessionId = (OMX_U8)m_session_id;
        break;
     }
 
@@ -2652,9 +2652,9 @@
                     memcpy(pcmparam,&m_pcm_param,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
 
-                    DEBUG_PRINT("get_parameter: Sampling rate %lu",\
+                    DEBUG_PRINT("get_parameter: Sampling rate %u",\
                                  pcmparam->nSamplingRate);
-                    DEBUG_PRINT("get_parameter: Number of channels %lu",\
+                    DEBUG_PRINT("get_parameter: Number of channels %u",\
                                  pcmparam->nChannels);
                 } else
                 {
@@ -2679,7 +2679,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamVideoInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2689,7 +2689,7 @@
                 OMX_PRIORITYMGMTTYPE *priorityMgmtType =
                 (OMX_PRIORITYMGMTTYPE*)paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamPriorityMgmt\n");
-                priorityMgmtType->nSize = sizeof(priorityMgmtType);
+                priorityMgmtType->nSize = (OMX_U32)sizeof(priorityMgmtType);
                 priorityMgmtType->nVersion.nVersion = OMX_SPEC_VERSION;
                 priorityMgmtType->nGroupID = m_priority_mgm.nGroupID;
                 priorityMgmtType->nGroupPriority =
@@ -2702,7 +2702,7 @@
                 (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamImageInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2717,7 +2717,7 @@
                 DEBUG_PRINT("get_parameter: \
 				OMX_IndexParamCompBufferSupplier\n");
 
-                bufferSupplierType->nSize = sizeof(bufferSupplierType);
+                bufferSupplierType->nSize = (OMX_U32)sizeof(bufferSupplierType);
                 bufferSupplierType->nVersion.nVersion = OMX_SPEC_VERSION;
                 if (OMX_CORE_INPUT_PORT_INDEX   ==
 			bufferSupplierType->nPortIndex)
@@ -2746,7 +2746,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamOtherInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2854,7 +2854,7 @@
                     return OMX_ErrorIncorrectStateOperation;
                 }
                 DEBUG_PRINT("OMX_IndexParamPortDefinition portDefn->nPortIndex "
-                            "= %lu\n",portDefn->nPortIndex);
+                            "= %u\n",portDefn->nPortIndex);
                 if (OMX_CORE_INPUT_PORT_INDEX == portDefn->nPortIndex)
                 {
                     if ( portDefn->nBufferCountActual >
@@ -2898,10 +2898,10 @@
                 }
                 OMX_PRIORITYMGMTTYPE *priorityMgmtype
                 = (OMX_PRIORITYMGMTTYPE*) paramData;
-                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %lu\n",
+                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %u\n",
                             priorityMgmtype->nGroupID);
 
-                DEBUG_PRINT("set_parameter: priorityMgmtype %lu\n",
+                DEBUG_PRINT("set_parameter: priorityMgmtype %u\n",
                             priorityMgmtype->nGroupPriority);
 
                 m_priority_mgm.nGroupID = priorityMgmtype->nGroupID;
@@ -2923,7 +2923,7 @@
 				portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("set_parameter: OMX_IndexParamAudioFormat:"\
-                                " %lu\n", portFormatType->nIndex);
+                                " %u\n", portFormatType->nIndex);
                     portFormatType->eEncoding = OMX_AUDIO_CodingAAC;
                 } else
                 {
@@ -2953,7 +2953,7 @@
 				bufferSupplierType->eBufferSupplier;
                 } else
                 {
-                    DEBUG_PRINT_ERROR("set_param:IndexParamCompBufferSup \ 
+                    DEBUG_PRINT_ERROR("set_param:IndexParamCompBufferSup\
 					%08x\n", eRet);
                     eRet = OMX_ErrorBadPortIndex;
                 }
@@ -2972,7 +2972,7 @@
                     memcpy(&m_pcm_param,pcmparam,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
 
-                    DEBUG_PRINT("set_pcm_parameter: %lu %lu",\
+                    DEBUG_PRINT("set_pcm_parameter: %u %u",\
                                 m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
                 } else
@@ -3050,7 +3050,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == volume->nPortIndex)
                 {
-                    volume->nSize = sizeof(volume);
+                    volume->nSize = (OMX_U32)sizeof(volume);
                     volume->nVersion.nVersion = OMX_SPEC_VERSION;
                     volume->bLinear = OMX_TRUE;
                     volume->sVolume.nValue = m_volume;
@@ -3070,7 +3070,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == mute->nPortIndex)
                 {
-                    mute->nSize = sizeof(mute);
+                    mute->nSize = (OMX_U32)sizeof(mute);
                     mute->nVersion.nVersion = OMX_SPEC_VERSION;
                     mute->bMute = (BITMASK_PRESENT(&m_flags,
                                       OMX_COMPONENT_MUTED)?OMX_TRUE:OMX_FALSE);
@@ -3278,8 +3278,8 @@
 
     if((hComp == NULL) || (peerComponent == NULL) || (tunnelSetup == NULL))
     {
-        port = 0;
-        peerPort = 0;
+        port = port;
+        peerPort = peerPort;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3319,7 +3319,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         free(buf_ptr);
         return OMX_ErrorBadParameter;
@@ -3332,7 +3332,7 @@
 
         bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) + sizeof(META_IN)+
                                                sizeof(OMX_BUFFERHEADERTYPE));
-        bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+        bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
         bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
         bufHdr->nAllocLen         = nBufSize;
         bufHdr->pAppPrivate       = appData;
@@ -3341,7 +3341,7 @@
 
         m_inp_current_buf_count++;
         DEBUG_PRINT("AIB:bufHdr %p bufHdr->pBuffer %p m_inp_buf_cnt=%d \
-		bytes=%lu",bufHdr, bufHdr->pBuffer,m_inp_current_buf_count,
+		bytes=%u",bufHdr, bufHdr->pBuffer,m_inp_current_buf_count,
 		bytes);
 
     } else
@@ -3373,7 +3373,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3390,7 +3390,7 @@
             bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr)+
 					sizeof(OMX_BUFFERHEADERTYPE));
 
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             bufHdr->pAppPrivate       = appData;
@@ -3398,7 +3398,7 @@
             m_output_buf_hdrs.insert(bufHdr, NULL);
             m_out_current_buf_count++;
             DEBUG_PRINT("AOB::bufHdr %p bufHdr->pBuffer %p m_out_buf_cnt=%d "\
-                        "bytes=%lu",bufHdr, bufHdr->pBuffer,\
+                        "bytes=%u",bufHdr, bufHdr->pBuffer,\
                         m_out_current_buf_count, bytes);
         } else
         {
@@ -3612,7 +3612,7 @@
         }
     }
   }
-    DEBUG_PRINT("Use Buffer for port[%lu] eRet[%d]\n", port,eRet);
+    DEBUG_PRINT("Use Buffer for port[%u] eRet[%d]\n", port,eRet);
     return eRet;
 }
 /*=============================================================================
@@ -3655,7 +3655,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3677,8 +3677,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_input_buffer:bufHdr %p bufHdr->pBuffer %p \
-			bytes=%lu", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			bytes=%u", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             input_buffer_size         = nBufSize;
@@ -3740,7 +3740,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3766,8 +3766,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_output_buffer:bufHdr %p bufHdr->pBuffer %p \
-			len=%lu\n", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			len=%u\n", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             output_buffer_size        = nBufSize;
@@ -3866,7 +3866,7 @@
                (m_out_bEnabled == OMX_FALSE &&
 		port == OMX_CORE_OUTPUT_PORT_INDEX))
     {
-        DEBUG_PRINT("Free Buffer while port %lu disabled\n", port);
+        DEBUG_PRINT("Free Buffer while port %u disabled\n", port);
     } else if (m_state == OMX_StateExecuting || m_state == OMX_StatePause)
     {
         DEBUG_PRINT("Invalid state to free buffer,ports need to be disabled:\
@@ -3998,7 +3998,7 @@
 {
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
 
-    DEBUG_PRINT("ETB:Buf:%p Len %lu TS %lld numInBuf=%d\n", \
+    DEBUG_PRINT("ETB:Buf:%p Len %u TS %lld numInBuf=%d\n", \
                 buffer, buffer->nFilledLen, buffer->nTimeStamp, (nNumInputBuf));
     if (m_state == OMX_StateInvalid)
     {
@@ -4036,11 +4036,11 @@
     {
         if (search_input_bufhdr(buffer) == true)
         {
-            post_input((unsigned)hComp,
-                       (unsigned) buffer,OMX_COMPONENT_GENERATE_ETB);
+            post_input((unsigned long)hComp,
+                       (unsigned long) buffer,OMX_COMPONENT_GENERATE_ETB);
         } else
         {
-            DEBUG_PRINT_ERROR("Bad header %x \n", (int)buffer);
+            DEBUG_PRINT_ERROR("Bad header %p \n", buffer);
             eRet = OMX_ErrorBadParameter;
         }
     }
@@ -4082,11 +4082,11 @@
         data = m_tmp_meta_buf;
 
         // copy the metadata info from the BufHdr and insert to payload
-        meta_in.offsetVal  = sizeof(META_IN);
+        meta_in.offsetVal  = (OMX_U16)sizeof(META_IN);
         meta_in.nTimeStamp.LowPart =
-           ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
+           (unsigned int)((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
         meta_in.nTimeStamp.HighPart =
-           (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
+          (unsigned int) (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
         meta_in.nFlags &= ~OMX_BUFFERFLAG_EOS;
         if(buffer->nFlags & OMX_BUFFERFLAG_EOS)
         {
@@ -4112,7 +4112,7 @@
         /* Assume empty this buffer function has already checked
         validity of buffer */
         DEBUG_PRINT("Empty buffer %p to kernel driver\n", buffer);
-        post_input((unsigned) & hComp,(unsigned) buffer,
+        post_input((unsigned long) & hComp,(unsigned long) buffer,
                    OMX_COMPONENT_GENERATE_BUFFER_DONE);
     }
     return OMX_ErrorNone;
@@ -4125,7 +4125,7 @@
 {
     OMX_STATETYPE state;
     ENC_META_OUT *meta_out = NULL;
-    int nReadbytes = 0;
+    ssize_t nReadbytes = 0;
     int szadifhr = 0;
     int numframes = 0;
     int metainfo  = 0;
@@ -4150,10 +4150,10 @@
                 return OMX_ErrorBadParameter;
             szadifhr = AUDAAC_MAX_ADIF_HEADER_LENGTH; 
             numframes =  *m_tmp_out_meta_buf;
-            metainfo  = ((sizeof(ENC_META_OUT) * numframes)+
+            metainfo  = (int)((sizeof(ENC_META_OUT) * numframes)+
 			sizeof(unsigned char));
             audaac_rec_install_adif_header_variable(0,sample_idx,
-						m_aac_param.nChannels);
+				(OMX_U8)m_aac_param.nChannels);
             memcpy(buffer->pBuffer,m_tmp_out_meta_buf,metainfo);
             memcpy(buffer->pBuffer + metainfo,&audaac_header_adif[0],szadifhr);
             memcpy(buffer->pBuffer + metainfo + szadifhr,
@@ -4177,7 +4177,7 @@
         {
             DEBUG_PRINT("OMX_AUDIO_AACStreamFormatMP4FF\n");
             audaac_rec_install_mp4ff_header_variable(0,sample_idx,
-							m_aac_param.nChannels);
+						(OMX_U8)m_aac_param.nChannels);
             memcpy(buffer->pBuffer,&audaac_header_mp4ff[0],
 			AUDAAC_MAX_MP4FF_HEADER_LENGTH);
             buffer->nFilledLen = AUDAAC_MAX_MP4FF_HEADER_LENGTH;
@@ -4215,7 +4215,7 @@
          nTimestamp = buffer->nTimeStamp;
          buffer->nFlags |= meta_out->nflags;
          buffer->nOffset =  meta_out->offset_to_frame + 1;
-         buffer->nFilledLen = nReadbytes - buffer->nOffset + szadifhr;
+         buffer->nFilledLen = (OMX_U32)(nReadbytes - buffer->nOffset + szadifhr);
          DEBUG_PRINT("nflags %d frame_size %d offset_to_frame %d \
 		timestamp %lld\n", meta_out->nflags,
 		meta_out->frame_size,
@@ -4250,7 +4250,7 @@
           {
               DEBUG_PRINT("FTBP:Post the FBD to event thread currstate=%d\n",\
                             state);
-              post_output((unsigned) & hComp,(unsigned) buffer,
+              post_output((unsigned long) & hComp,(unsigned long) buffer,
                             OMX_COMPONENT_GENERATE_FRAME_DONE);
           }
           else
@@ -4317,8 +4317,8 @@
     m_aac_pb_stats.ftb_cnt++;
     DEBUG_DETAIL("FTB:nNumOutputBuf is %d", nNumOutputBuf);
     pthread_mutex_unlock(&out_buf_count_lock);
-    post_output((unsigned)hComp,
-                (unsigned) buffer,OMX_COMPONENT_GENERATE_FTB);
+    post_output((unsigned long)hComp,
+                (unsigned long) buffer,OMX_COMPONENT_GENERATE_FTB);
     return eRet;
 }
 
@@ -4401,11 +4401,11 @@
 {
     DEBUG_PRINT("Component-deinit being processed\n");
     DEBUG_PRINT("********************************\n");
-    DEBUG_PRINT("STATS: in-buf-len[%lu]out-buf-len[%lu] tot-pb-time[%ld]",\
+    DEBUG_PRINT("STATS: in-buf-len[%u]out-buf-len[%u] tot-pb-time[%lld]",\
                 m_aac_pb_stats.tot_in_buf_len,
                 m_aac_pb_stats.tot_out_buf_len,
                 m_aac_pb_stats.tot_pb_time);
-    DEBUG_PRINT("STATS: fbd-cnt[%lu]ftb-cnt[%lu]etb-cnt[%lu]ebd-cnt[%lu]",\
+    DEBUG_PRINT("STATS: fbd-cnt[%u]ftb-cnt[%u]etb-cnt[%u]ebd-cnt[%u]",\
                 m_aac_pb_stats.fbd_cnt,m_aac_pb_stats.ftb_cnt,
                 m_aac_pb_stats.etb_cnt,
                 m_aac_pb_stats.ebd_cnt);
@@ -4547,8 +4547,8 @@
 
     if((hComp == NULL) || (appData == NULL) || (eglImage == NULL))
     {
-        bufferHdr = NULL;
-        port = 0;
+        bufferHdr = bufferHdr;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -4582,8 +4582,8 @@
     }
     if (index == 0 && role)
     {
-        memcpy(role, cmp_role, sizeof(cmp_role));
-        *(((char *) role) + sizeof(cmp_role)) = '\0';
+        memcpy(role, cmp_role, strlen(cmp_role));
+        *(((char *) role) + strlen(cmp_role) + 1) = '\0';
     } else
     {
         eRet = OMX_ErrorNoMore;
@@ -4708,7 +4708,7 @@
   audaac_hdr_bit_index = 32;
   num_fce = 1;
   /* Store Header Id "ADIF" first */
-  memcpy(&audaac_header_adif[0], "ADIF", sizeof(OMX_U32));
+  memcpy(&audaac_header_adif[0], "ADIF", sizeof(unsigned int));
 
   /* copyright_id_present field, 1 bit */
   value = 0;
@@ -4971,19 +4971,19 @@
     byte_index = (*hdr_bit_index) >> 3;
     bit_index  = (*hdr_bit_index) &  0x07;
 
-    bits_avail_in_byte = 8 - bit_index;
+    bits_avail_in_byte = (OMX_U8)(8 - bit_index);
 
     num_to_copy = min(bits_avail_in_byte, num_remaining);
 
-    byte_to_copy = ((OMX_U8)((value >> (num_remaining - num_to_copy)) & 0xFF) <<
+    byte_to_copy = (OMX_U8)((OMX_U8)((value >> (num_remaining - num_to_copy)) & 0xFF) <<
                     (bits_avail_in_byte - num_to_copy));
 
     input[byte_index] &= ((OMX_U8)(bit_mask << bits_avail_in_byte));
     input[byte_index] |= byte_to_copy;
 
-    *hdr_bit_index += num_to_copy;
+    *hdr_bit_index = (OMX_U16)(*hdr_bit_index + num_to_copy);
 
-    num_remaining -= num_to_copy;
+    num_remaining = (OMX_U8)(num_remaining - num_to_copy);
   }
 }
 void  omx_aac_aenc::audaac_rec_install_mp4ff_header_variable (OMX_U16  byte_num,
diff --git a/mm-audio/aenc-aac/qdsp6/test/omx_aac_enc_test.c b/mm-audio/aenc-aac/qdsp6/test/omx_aac_enc_test.c
index c3e4b0a..174cde6 100644
--- a/mm-audio/aenc-aac/qdsp6/test/omx_aac_enc_test.c
+++ b/mm-audio/aenc-aac/qdsp6/test/omx_aac_enc_test.c
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -110,7 +110,7 @@
 uint32_t bitrate = 128000;
 uint32_t pcmplayback = 0;
 uint32_t tunnel      = 0;
-uint32_t rectime     = -1;
+uint32_t rectime     = 0;
 uint32_t format = 1;
 uint32_t profile = OMX_AUDIO_AACObjectLC;
 #define DEBUG_PRINT printf
@@ -203,13 +203,13 @@
         unsigned int nflags;
 } __attribute__ ((packed));
 
-static unsigned totaldatalen = 0;
+static int totaldatalen = 0;
 /************************************************************************/
 /*                GLOBAL INIT                    */
 /************************************************************************/
 
-int input_buf_cnt = 0;
-int output_buf_cnt = 0;
+unsigned int input_buf_cnt = 0;
+unsigned int output_buf_cnt = 0;
 int used_ip_buf_cnt = 0;
 volatile int event_is_done = 0;
 volatile int ebd_event_is_done = 0;
@@ -250,7 +250,7 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *aac_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize);
+                                       unsigned int bufCntMin, unsigned int bufSize);
 
 
 static OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
@@ -323,7 +323,7 @@
 
     switch(eEvent) {
         case OMX_EventCmdComplete:
-        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%lu data2=%lu\n",(OMX_EVENTTYPE)eEvent,
+        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%u data2=%u\n",(OMX_EVENTTYPE)eEvent,
                                                                                nData1,nData2);
             event_complete();
         break;
@@ -350,8 +350,8 @@
                               OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
 {
     size_t bytes_writen = 0;
-    int total_bytes_writen = 0;
-    unsigned int len = 0;
+    size_t total_bytes_writen = 0;
+    size_t len = 0;
     struct enc_meta_out *meta = NULL;
     OMX_U8 *src = pBuffer->pBuffer;
     unsigned int num_of_frames = 1;
@@ -390,7 +390,7 @@
 
             if(format == 6)
             {
-                audaac_rec_install_adts_header_variable(len + AUDAAC_MAX_ADTS_HEADER_LENGTH);
+                audaac_rec_install_adts_header_variable((uint16_t)(len + AUDAAC_MAX_ADTS_HEADER_LENGTH));
                 bytes_writen = fwrite(audaac_header,1,AUDAAC_MAX_ADTS_HEADER_LENGTH,outputBufferFile);
                 if(bytes_writen < AUDAAC_MAX_ADTS_HEADER_LENGTH)
                 {
@@ -408,8 +408,8 @@
             num_of_frames--;
             total_bytes_writen += len;
         }
-        DEBUG_PRINT(" FillBufferDone size writen to file  %d\n",total_bytes_writen);
-        totaldatalen += total_bytes_writen ;
+        DEBUG_PRINT(" FillBufferDone size writen to file  %zu\n",total_bytes_writen);
+        totaldatalen = totaldatalen + (int)total_bytes_writen;
 
         DEBUG_PRINT(" FBD calling FTB\n");
         OMX_FillThisBuffer(hComponent,pBuffer);
@@ -461,7 +461,7 @@
     }
 
     if((readBytes = Read_Buffer(pBuffer)) > 0) {
-        pBuffer->nFilledLen = readBytes;
+        pBuffer->nFilledLen = (OMX_U32)readBytes;
         used_ip_buf_cnt++;
         OMX_EmptyThisBuffer(hComponent,pBuffer);
     }
@@ -498,7 +498,7 @@
 
 int main(int argc, char **argv)
 {
-     int bufCnt=0;
+     unsigned int bufCnt=0;
      OMX_ERRORTYPE result;
 
     struct sigaction sa;
@@ -520,13 +520,13 @@
     if (argc >= 9) {
       in_filename = argv[1];
       out_filename = argv[2];
-      samplerate = atoi(argv[3]);
-      channels = atoi(argv[4]);
-      tunnel  = atoi(argv[5]);
-      rectime = atoi(argv[6]);
-      bitrate = atoi(argv[7]);
-      format =  atoi(argv[8]);
-      profile = atoi(argv[9]);
+      samplerate = (uint32_t)atoi(argv[3]);
+      channels = (uint32_t)atoi(argv[4]);
+      tunnel  = (uint32_t)atoi(argv[5]);
+      rectime = (uint32_t)atoi(argv[6]);
+      bitrate = (uint32_t)atoi(argv[7]);
+      format =  (uint32_t)atoi(argv[8]);
+      profile = (uint32_t)atoi(argv[9]);
 
 	  DEBUG_PRINT("Input parameters: samplerate = %d, channels = %d, tunnel = %d,"
 				  " rectime = %d, bitrate = %d, format = %d, profile = %d\n",
@@ -724,7 +724,7 @@
     /* Query for audio decoders*/
     DEBUG_PRINT("Aac_test: Before entering OMX_GetComponentOfRole");
     OMX_GetComponentsOfRole(role, &total, 0);
-    DEBUG_PRINT ("\nTotal components of role=%s :%lu", role, total);
+    DEBUG_PRINT ("\nTotal components of role=%s :%u", role, total);
 
 
     omxresult = OMX_GetHandle((OMX_HANDLETYPE*)(&aac_enc_handle),
@@ -749,8 +749,8 @@
     }
     else
     {
-        DEBUG_PRINT("\nportParam.nPorts:%lu\n", portParam.nPorts);
-    DEBUG_PRINT("\nportParam.nStartPortNumber:%lu\n",
+        DEBUG_PRINT("\nportParam.nPorts:%u\n", portParam.nPorts);
+    DEBUG_PRINT("\nportParam.nStartPortNumber:%u\n",
                                              portParam.nStartPortNumber);
     }
     return 0;
@@ -758,12 +758,16 @@
 
 int Play_Encoder()
 {
-    int i;
+    unsigned int i;
     int Size=0;
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE ret;
     OMX_INDEXTYPE index;
+#ifdef __LP64__
+    DEBUG_PRINT("sizeof[%ld]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#else
     DEBUG_PRINT("sizeof[%d]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#endif
 
     /* open the i/p and o/p files based on the video file format passed */
     if(open_audio_file()) {
@@ -778,8 +782,8 @@
     inputportFmt.nPortIndex = portParam.nStartPortNumber;
 
     OMX_GetParameter(aac_enc_handle,OMX_IndexParamPortDefinition,&inputportFmt);
-    DEBUG_PRINT ("\nEnc Input Buffer Count %lu\n", inputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Input Buffer Size %lu\n", inputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc Input Buffer Count %u\n", inputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Input Buffer Size %u\n", inputportFmt.nBufferSize);
 
     if(OMX_DirInput != inputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Input Port\n");
@@ -798,8 +802,8 @@
     outputportFmt.nPortIndex = portParam.nStartPortNumber + 1;
 
     OMX_GetParameter(aac_enc_handle,OMX_IndexParamPortDefinition,&outputportFmt);
-    DEBUG_PRINT ("\nEnc: Output Buffer Count %lu\n", outputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Output Buffer Size %lu\n", outputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc: Output Buffer Count %u\n", outputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Output Buffer Size %u\n", outputportFmt.nBufferSize);
 
     if(OMX_DirOutput != outputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Output Port\n");
@@ -894,7 +898,7 @@
     for(i=0; i < output_buf_cnt; i++) {
         DEBUG_PRINT ("\nOMX_FillThisBuffer on output buf no.%d\n",i);
         pOutputBufHdrs[i]->nOutputPortIndex = 1;
-        pOutputBufHdrs[i]->nFlags &= ~OMX_BUFFERFLAG_EOS;
+        pOutputBufHdrs[i]->nFlags = pOutputBufHdrs[i]->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
         ret = OMX_FillThisBuffer(aac_enc_handle, pOutputBufHdrs[i]);
         if (OMX_ErrorNone != ret) {
             DEBUG_PRINT("OMX_FillThisBuffer failed with result %d\n", ret);
@@ -916,7 +920,7 @@
           bInputEosReached = true;
           pInputBufHdrs[i]->nFlags= OMX_BUFFERFLAG_EOS;
         }
-        pInputBufHdrs[i]->nFilledLen = Size;
+        pInputBufHdrs[i]->nFilledLen = (OMX_U32)Size;
         pInputBufHdrs[i]->nInputPortIndex = 0;
         used_ip_buf_cnt++;
         ret = OMX_EmptyThisBuffer(aac_enc_handle, pInputBufHdrs[i]);
@@ -954,11 +958,11 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *avc_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize)
+                                       unsigned int bufCntMin, unsigned int bufSize)
 {
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE error=OMX_ErrorNone;
-    long bufCnt=0;
+    unsigned int bufCnt=0;
     /* To remove warning for unused variable to keep prototype same */
     (void)avc_enc_handle;
 
@@ -966,7 +970,7 @@
                    malloc(sizeof(OMX_BUFFERHEADERTYPE*)*bufCntMin);
 
     for(bufCnt=0; bufCnt < bufCntMin; ++bufCnt) {
-        DEBUG_PRINT("\n OMX_AllocateBuffer No %ld \n", bufCnt);
+        DEBUG_PRINT("\n OMX_AllocateBuffer No %d \n", bufCnt);
         error = OMX_AllocateBuffer(aac_enc_handle, &((*pBufHdrs)[bufCnt]),
                                    nPortIndex, NULL, bufSize);
     }
@@ -980,7 +984,7 @@
 static int Read_Buffer (OMX_BUFFERHEADERTYPE  *pBufHdr )
 {
 
-    int bytes_read=0;
+    size_t bytes_read=0;
 
 
     pBufHdr->nFilledLen = 0;
@@ -988,7 +992,7 @@
 
      bytes_read = fread(pBufHdr->pBuffer, 1, pBufHdr->nAllocLen , inputBufferFile);
 
-      pBufHdr->nFilledLen = bytes_read;
+      pBufHdr->nFilledLen = (OMX_U32)bytes_read;
         if(bytes_read == 0)
         {
 
@@ -997,10 +1001,10 @@
         }
         else
         {
-            pBufHdr->nFlags &= ~OMX_BUFFERFLAG_EOS;
+            pBufHdr->nFlags = pBufHdr->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
         }
 
-    return bytes_read;;
+    return (int)bytes_read;
 }
 
 
@@ -1062,11 +1066,11 @@
     byte_index = (*hdr_bit_index) >> 3;
     bit_index  = (*hdr_bit_index) &  0x07;
 
-    bits_avail_in_byte = 8 - bit_index;
+    bits_avail_in_byte = (uint8)(8 - bit_index);
 
     num_to_copy = MIN(bits_avail_in_byte, num_remaining);
 
-    byte_to_copy = ((uint8)((value >> (num_remaining - num_to_copy)) & 0xFF) <<
+    byte_to_copy = (uint8)(((value >> (num_remaining - num_to_copy)) & 0xFF) <<
                     (bits_avail_in_byte - num_to_copy));
 
     input[byte_index] &= ((uint8)(bit_mask << bits_avail_in_byte));
@@ -1074,7 +1078,7 @@
 
     *hdr_bit_index += num_to_copy;
 
-    num_remaining -= num_to_copy;
+    num_remaining = (uint8)(num_remaining - num_to_copy);
   } /* while (num_remaining) */
 } /* audaac_rec_install_bits */
 
@@ -1138,7 +1142,7 @@
   uint32  value;
 
   uint32   sample_index = samplerate;
-  uint8   channel_config = channels;
+  uint8   channel_config = (uint8)channels;
 
   /* Store Sync word first */
   audaac_header[0] = 0xFF;
diff --git a/mm-audio/aenc-amrnb/Android.mk b/mm-audio/aenc-amrnb/Android.mk
index 79474c6..285ad9d 100644
--- a/mm-audio/aenc-amrnb/Android.mk
+++ b/mm-audio/aenc-amrnb/Android.mk
@@ -1,4 +1,4 @@
-ifeq ($(TARGET_ARCH),arm)
+ifneq ($(filter arm aarch64 arm64, $(TARGET_ARCH)),)
 
 
 AENC_AMR_PATH:= $(call my-dir)
@@ -27,5 +27,8 @@
 ifeq ($(call is-board-platform,msm8916),true)
 include $(AENC_AMR_PATH)/qdsp6/Android.mk
 endif
+ifeq ($(call is-board-platform,msm8994),true)
+include $(AENC_AMR_PATH)/qdsp6/Android.mk
+endif
 
 endif
diff --git a/mm-audio/aenc-amrnb/qdsp6/Android.mk b/mm-audio/aenc-amrnb/qdsp6/Android.mk
index b97e2e5..21efdfd 100644
--- a/mm-audio/aenc-amrnb/qdsp6/Android.mk
+++ b/mm-audio/aenc-amrnb/qdsp6/Android.mk
@@ -13,6 +13,7 @@
 libOmxAmrEnc-def += -D_ENABLE_QC_MSG_LOG_
 libOmxAmrEnc-def += -DVERBOSE
 libOmxAmrEnc-def += -D_DEBUG
+libOmxAmrEnc-def += -Wconversion
 ifeq ($(strip $(TARGET_USES_QCOM_MM_AUDIO)),true)
 libOmxAmrEnc-def += -DAUDIOV2
 endif
diff --git a/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h b/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h
index 4b89765..ed7f758 100644
--- a/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h
+++ b/mm-audio/aenc-amrnb/qdsp6/inc/omx_amr_aenc.h
@@ -1,6 +1,6 @@
 /*--------------------------------------------------------------------------
 
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010,2014 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -82,10 +82,10 @@
 
 
 #define PrintFrameHdr(i,bufHdr) \
-                           DEBUG_PRINT("i=%d OMX bufHdr[%x]buf[%x]size[%d]TS[%lld]nFlags[0x%x]\n",\
+                           DEBUG_PRINT("i=%d OMX bufHdr[%p]buf[%p]size[%d]TS[%lld]nFlags[0x%x]\n",\
                            i,\
-                           (unsigned) bufHdr,                                     \
-                           (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
+                           bufHdr,                                     \
+                           ((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFilledLen,\
                            ((OMX_BUFFERHEADERTYPE *)bufHdr)->nTimeStamp, \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFlags)
@@ -244,7 +244,7 @@
                                 void *                  eglImage);
 
     bool post_command(unsigned int p1, unsigned int p2,
-        unsigned int id);
+        unsigned char id);
 
     // Deferred callback identifiers
     enum
@@ -303,9 +303,9 @@
 
     struct omx_event
     {
-        unsigned param1;
-        unsigned param2;
-        unsigned id;
+        unsigned long param1;
+        unsigned long param2;
+        unsigned char id;
     };
 
     struct omx_cmd_queue
@@ -317,16 +317,16 @@
 
         omx_cmd_queue();
         ~omx_cmd_queue();
-        bool insert_entry(unsigned p1, unsigned p2, unsigned id);
-        bool pop_entry(unsigned *p1,unsigned *p2, unsigned *id);
-        bool get_msg_id(unsigned *id);
+        bool insert_entry(unsigned long p1, unsigned long p2, unsigned char id);
+        bool pop_entry(unsigned long *p1,unsigned long *p2, unsigned char *id);
+        bool get_msg_id(unsigned char *id);
         bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned id);
     };
 
     typedef struct TIMESTAMP
     {
-        unsigned long LowPart;
-        unsigned long HighPart;
+        unsigned int LowPart;
+        unsigned int HighPart;
     }__attribute__((packed)) TIMESTAMP;
 
     typedef struct metadata_input
@@ -350,7 +350,7 @@
     {
         OMX_U32 tot_in_buf_len;
         OMX_U32 tot_out_buf_len;
-        OMX_U32 tot_pb_time;
+        OMX_TICKS tot_pb_time;
         OMX_U32 fbd_cnt;
         OMX_U32 ftb_cnt;
         OMX_U32 etb_cnt;
@@ -507,11 +507,11 @@
 
     bool search_output_bufhdr(OMX_BUFFERHEADERTYPE *buffer);
 
-    bool post_input(unsigned int p1, unsigned int p2,
-                    unsigned int id);
+    bool post_input(unsigned long p1, unsigned long p2,
+                    unsigned char id);
 
-    bool post_output(unsigned int p1, unsigned int p2,
-                     unsigned int id);
+    bool post_output(unsigned long p1, unsigned long p2,
+                     unsigned char id);
 
     void process_events(omx_amr_aenc *client_data);
 
diff --git a/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp b/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp
index c6233f8..f322b40 100644
--- a/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp
+++ b/mm-audio/aenc-amrnb/qdsp6/src/omx_amr_aenc.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -57,9 +57,9 @@
 }
 
 // omx cmd queue insert
-bool omx_amr_aenc::omx_cmd_queue::insert_entry(unsigned p1,
-                                                unsigned p2,
-                                                unsigned id)
+bool omx_amr_aenc::omx_cmd_queue::insert_entry(unsigned long p1,
+                                                unsigned long p2,
+                                                unsigned char id)
 {
     bool ret = true;
     if (m_size < OMX_CORE_CONTROL_CMDQ_SIZE)
@@ -81,8 +81,8 @@
     return ret;
 }
 
-bool omx_amr_aenc::omx_cmd_queue::pop_entry(unsigned *p1,
-                                             unsigned *p2, unsigned *id)
+bool omx_amr_aenc::omx_cmd_queue::pop_entry(unsigned long *p1,
+                                             unsigned long *p2, unsigned char *id)
 {
     bool ret = true;
     if (m_size > 0)
@@ -111,7 +111,7 @@
 {
     return(new omx_amr_aenc);
 }
-bool omx_amr_aenc::omx_cmd_queue::get_msg_id(unsigned *id)
+bool omx_amr_aenc::omx_cmd_queue::get_msg_id(unsigned char *id)
 {
    if(m_size > 0)
    {
@@ -256,7 +256,10 @@
         m_tmp_out_meta_buf(NULL),
         m_flush_cnt(255),
         m_comp_deinit(0),
+        m_volume(25),
         m_app_data(NULL),
+        nNumInputBuf(0),
+        nNumOutputBuf(0),
         m_drv_fd(-1),
         bFlushinprogress(0),
         is_in_th_sleep(false),
@@ -264,12 +267,14 @@
         m_flags(0),
         nTimestamp(0),
         ts(0),
+        pcm_input(0),
         m_inp_act_buf_count (OMX_CORE_NUM_INPUT_BUFFERS),
         m_out_act_buf_count (OMX_CORE_NUM_OUTPUT_BUFFERS),
         m_inp_current_buf_count(0),
         m_out_current_buf_count(0),
-        output_buffer_size(OMX_AMR_OUTPUT_BUFFER_SIZE),
+        output_buffer_size((OMX_U32)OMX_AMR_OUTPUT_BUFFER_SIZE),
         input_buffer_size(OMX_CORE_INPUT_BUFFER_SIZE),
+        m_session_id(0),
         m_inp_bEnabled(OMX_TRUE),
         m_out_bEnabled(OMX_TRUE),
         m_inp_bPopulated(OMX_FALSE),
@@ -278,12 +283,7 @@
         m_state(OMX_StateInvalid),
         m_ipc_to_in_th(NULL),
         m_ipc_to_out_th(NULL),
-        m_ipc_to_cmd_th(NULL),
-        pcm_input(0),
-        m_volume(25),
-        m_session_id(0),
-        nNumOutputBuf(0),
-        nNumInputBuf(0)
+        m_ipc_to_cmd_th(NULL)
 {
     int cond_ret = 0;
     component_Role.nSize = 0;
@@ -504,13 +504,13 @@
         m_amr_pb_stats.fbd_cnt++;
         pthread_mutex_lock(&out_buf_count_lock);
         nNumOutputBuf--;
-        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%lu fbd_cnt=%lu\n",\
+        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%u fbd_cnt=%u\n",\
                     nNumOutputBuf,
                     m_amr_pb_stats.tot_out_buf_len,
                     m_amr_pb_stats.fbd_cnt);
         m_amr_pb_stats.tot_out_buf_len += bufHdr->nFilledLen;
         m_amr_pb_stats.tot_pb_time     = bufHdr->nTimeStamp;
-        DEBUG_PRINT("FBD:in_buf_len=%lu out_buf_len=%lu\n",
+        DEBUG_PRINT("FBD:in_buf_len=%u out_buf_len=%u\n",
                     m_amr_pb_stats.tot_in_buf_len,
                     m_amr_pb_stats.tot_out_buf_len);
 
@@ -544,9 +544,9 @@
 =============================================================================*/
 void omx_amr_aenc::process_out_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;                 // qsize
     unsigned      tot_qsize = 0;
     omx_amr_aenc  *pThis    = (omx_amr_aenc *) client_data;
@@ -748,9 +748,9 @@
 =============================================================================*/
 void omx_amr_aenc::process_command_msg(void *client_data, unsigned char id)
 {
-    unsigned     p1;                             // Parameter - 1
-    unsigned     p2;                             // Parameter - 2
-    unsigned     ident;
+    unsigned long  p1 = 0;                             // Parameter - 1
+    unsigned long  p2 = 0;                             // Parameter - 2
+    unsigned char ident = 0;
     unsigned     qsize  = 0;
     omx_amr_aenc *pThis = (omx_amr_aenc*)client_data;
     pthread_mutex_lock(&pThis->m_commandlock);
@@ -822,15 +822,15 @@
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventError,
-                                         p2,
-                                         NULL,
-                                         NULL );
+                                         (OMX_U32)p2,
+                                         0,
+                                         0 );
             } else
             {
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventCmdComplete,
-                                         p1, p2, NULL );
+                                         (OMX_U32)p1, (OMX_U32)p2, NULL );
             }
         } else
         {
@@ -878,9 +878,9 @@
 =============================================================================*/
 void omx_amr_aenc::process_in_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;
     unsigned      tot_qsize = 0;
     omx_amr_aenc  *pThis    = (omx_amr_aenc *) client_data;
@@ -1058,12 +1058,12 @@
     randomly assign the value right now. Query will result in
     incorrect param */
     memset(&m_amr_param, 0, sizeof(m_amr_param));
-    m_amr_param.nSize = sizeof(m_amr_param);
+    m_amr_param.nSize = (OMX_U32)sizeof(m_amr_param);
     m_amr_param.nChannels = OMX_AMR_DEFAULT_CH_CFG;
     m_volume = OMX_AMR_DEFAULT_VOL;             /* Close to unity gain */
     memset(&m_amr_pb_stats,0,sizeof(AMR_PB_STATS));
     memset(&m_pcm_param, 0, sizeof(m_pcm_param));
-    m_pcm_param.nSize = sizeof(m_pcm_param);
+    m_pcm_param.nSize = (OMX_U32)sizeof(m_pcm_param);
     m_pcm_param.nChannels = OMX_AMR_DEFAULT_CH_CFG;
     m_pcm_param.nSamplingRate = OMX_AMR_DEFAULT_SF;
     nTimestamp = 0;
@@ -1094,20 +1094,20 @@
     if (!strcmp(role,"OMX.qcom.audio.encoder.amrnb"))
     {
         pcm_input = 1;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole, (const char*)role,
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else if (!strcmp(role,"OMX.qcom.audio.encoder.tunneled.amrnb"))
     {
         pcm_input = 0;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole, (const char*)role,
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else
     {
-        component_Role.nSize = sizeof("\0");
+        component_Role.nSize = (OMX_U32)sizeof("\0");
         strlcpy((char *)component_Role.cRole, (const char*)"\0",
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED is invalid\n", role);
@@ -1251,7 +1251,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1265,7 +1265,7 @@
     }
     post_command((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
     DEBUG_PRINT("Send Command : returns with OMX_ErrorNone \n");
-    DEBUG_PRINT("send_command : recieved state before semwait= %lu\n",param1);
+    DEBUG_PRINT("send_command : recieved state before semwait= %u\n",param1);
     sem_wait (&sem_States);
     DEBUG_PRINT("send_command : recieved state after semwait\n");
     return OMX_ErrorNone;
@@ -1295,7 +1295,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1461,7 +1461,7 @@
                     }
                     pcm_cfg.channel_count = m_pcm_param.nChannels;
                     pcm_cfg.sample_rate  =  m_pcm_param.nSamplingRate;
-                    DEBUG_PRINT("pcm config %lu %lu\n",m_pcm_param.nChannels,
+                    DEBUG_PRINT("pcm config %u %u\n",m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
 
                     if (ioctl(m_drv_fd, AUDIO_SET_CONFIG, &pcm_cfg) == -1)
@@ -1723,7 +1723,7 @@
     } else if (OMX_CommandFlush == cmd)
     {
         DEBUG_DETAIL("*************************\n");
-        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%lu\n",param1);
+        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%u\n",param1);
         DEBUG_DETAIL("*************************\n");
         bFlag = 0;
         if ( param1 == OMX_CORE_INPUT_PORT_INDEX ||
@@ -1762,7 +1762,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable in "\
-                                " param1=%lu m_state=%d \n",param1, m_state);
+                                " param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 DEBUG_PRINT("send_command_proxy:OMX_CommandPortDisable:\
@@ -1794,7 +1794,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable out "\
-                                "param1=%lu m_state=%d \n",param1, m_state);
+                                "param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 BITMASK_SET(&m_flags, OMX_COMPONENT_OUTPUT_DISABLE_PENDING);
@@ -1911,7 +1911,7 @@
 {
     bool bRet = true;
 
-    DEBUG_PRINT("Execute_omx_flush Port[%lu]", param1);
+    DEBUG_PRINT("Execute_omx_flush Port[%u]", param1);
     struct timespec abs_timeout;
     abs_timeout.tv_sec = 1;
     abs_timeout.tv_nsec = 0;
@@ -1961,7 +1961,7 @@
         DEBUG_DETAIL("WAITING FOR FLUSH ACK's param1=%d",param1);
         wait_for_event();
 
-        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%lu cmd_cmpl=%d",\
+        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%u cmd_cmpl=%d",\
                     param1,cmd_cmpl);
 
         // If not going to idle state, Send FLUSH complete message
@@ -2075,7 +2075,7 @@
         DEBUG_DETAIL("RECIEVED FLUSH ACK FOR O/P PORT param1=%d",param1);
     } else
     {
-        DEBUG_PRINT("Invalid Port ID[%lu]",param1);
+        DEBUG_PRINT("Invalid Port ID[%u]",param1);
     }
     return bRet;
 }
@@ -2103,9 +2103,9 @@
 bool omx_amr_aenc::execute_input_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2183,9 +2183,9 @@
 bool omx_amr_aenc::execute_output_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2266,9 +2266,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_amr_aenc::post_input(unsigned int p1,
-                               unsigned int p2,
-                               unsigned int id)
+bool omx_amr_aenc::post_input(unsigned long p1,
+                               unsigned long p2,
+                               unsigned char id)
 {
     bool bRet = false;
     pthread_mutex_lock(&m_lock);
@@ -2329,7 +2329,7 @@
 =============================================================================*/
 bool omx_amr_aenc::post_command(unsigned int p1,
                                  unsigned int p2,
-                                 unsigned int id)
+                                 unsigned char id)
 {
     bool bRet  = false;
 
@@ -2376,9 +2376,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_amr_aenc::post_output(unsigned int p1,
-                                unsigned int p2,
-                                unsigned int id)
+bool omx_amr_aenc::post_output(unsigned long p1,
+                                unsigned long p2,
+                                unsigned char id)
 {
     bool bRet = false;
 
@@ -2442,7 +2442,7 @@
         return OMX_ErrorBadParameter;
     }
 
-    switch (paramIndex)
+    switch ((int)paramIndex)
     {
         case OMX_IndexParamPortDefinition:
             {
@@ -2450,11 +2450,11 @@
                 portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
 
                 DEBUG_PRINT("OMX_IndexParamPortDefinition " \
-                            "portDefn->nPortIndex = %lu\n",
+                            "portDefn->nPortIndex = %u\n",
 				portDefn->nPortIndex);
 
                 portDefn->nVersion.nVersion = OMX_SPEC_VERSION;
-                portDefn->nSize = sizeof(portDefn);
+                portDefn->nSize = (OMX_U32)sizeof(portDefn);
                 portDefn->eDomain    = OMX_PortDomainAudio;
 
                 if (0 == portDefn->nPortIndex)
@@ -2496,7 +2496,7 @@
                 DEBUG_PRINT("OMX_IndexParamAudioInit\n");
 
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 2;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2508,7 +2508,7 @@
                 (OMX_AUDIO_PARAM_PORTFORMATTYPE *) paramData;
                 DEBUG_PRINT("OMX_IndexParamAudioPortFormat\n");
                 portFormatType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portFormatType->nSize = sizeof(portFormatType);
+                portFormatType->nSize = (OMX_U32)sizeof(portFormatType);
 
                 if (OMX_CORE_INPUT_PORT_INDEX == portFormatType->nPortIndex)
                 {
@@ -2518,7 +2518,7 @@
 				portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("get_parameter: OMX_IndexParamAudioFormat: "\
-                                "%lu\n", portFormatType->nIndex);
+                                "%u\n", portFormatType->nIndex);
 
             portFormatType->eEncoding = OMX_AUDIO_CodingAMR;
                 } else
@@ -2552,7 +2552,7 @@
     {
        QOMX_AUDIO_STREAM_INFO_DATA *streaminfoparam =
                (QOMX_AUDIO_STREAM_INFO_DATA *) paramData;
-       streaminfoparam->sessionId = m_session_id;
+       streaminfoparam->sessionId = (OMX_U8)m_session_id;
        break;
     }
 
@@ -2565,9 +2565,9 @@
                 {
                     memcpy(pcmparam,&m_pcm_param,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
-                    DEBUG_PRINT("get_parameter: Sampling rate %lu",\
+                    DEBUG_PRINT("get_parameter: Sampling rate %u",\
                                  pcmparam->nSamplingRate);
-                    DEBUG_PRINT("get_parameter: Number of channels %lu",\
+                    DEBUG_PRINT("get_parameter: Number of channels %u",\
                                  pcmparam->nChannels);
                 } else
                 {
@@ -2592,7 +2592,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamVideoInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2602,7 +2602,7 @@
                 OMX_PRIORITYMGMTTYPE *priorityMgmtType =
                 (OMX_PRIORITYMGMTTYPE*)paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamPriorityMgmt\n");
-                priorityMgmtType->nSize = sizeof(priorityMgmtType);
+                priorityMgmtType->nSize = (OMX_U32)sizeof(priorityMgmtType);
                 priorityMgmtType->nVersion.nVersion = OMX_SPEC_VERSION;
                 priorityMgmtType->nGroupID = m_priority_mgm.nGroupID;
                 priorityMgmtType->nGroupPriority =
@@ -2615,7 +2615,7 @@
                 (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamImageInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2630,7 +2630,7 @@
                 DEBUG_PRINT("get_parameter: \
 				OMX_IndexParamCompBufferSupplier\n");
 
-                bufferSupplierType->nSize = sizeof(bufferSupplierType);
+                bufferSupplierType->nSize = (OMX_U32)sizeof(bufferSupplierType);
                 bufferSupplierType->nVersion.nVersion = OMX_SPEC_VERSION;
                 if (OMX_CORE_INPUT_PORT_INDEX   ==
 				bufferSupplierType->nPortIndex)
@@ -2659,7 +2659,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamOtherInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2757,7 +2757,7 @@
                     return OMX_ErrorIncorrectStateOperation;
                 }
                 DEBUG_PRINT("OMX_IndexParamPortDefinition portDefn->nPortIndex "
-                            "= %lu\n",portDefn->nPortIndex);
+                            "= %u\n",portDefn->nPortIndex);
                 if (OMX_CORE_INPUT_PORT_INDEX == portDefn->nPortIndex)
                 {
                     if ( portDefn->nBufferCountActual >
@@ -2801,10 +2801,10 @@
                 }
                 OMX_PRIORITYMGMTTYPE *priorityMgmtype
                 = (OMX_PRIORITYMGMTTYPE*) paramData;
-                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %lu\n",
+                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %u\n",
                             priorityMgmtype->nGroupID);
 
-                DEBUG_PRINT("set_parameter: priorityMgmtype %lu\n",
+                DEBUG_PRINT("set_parameter: priorityMgmtype %u\n",
                             priorityMgmtype->nGroupPriority);
 
                 m_priority_mgm.nGroupID = priorityMgmtype->nGroupID;
@@ -2826,7 +2826,7 @@
 				portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("set_parameter: OMX_IndexParamAudioFormat:"\
-                                " %lu\n", portFormatType->nIndex);
+                                " %u\n", portFormatType->nIndex);
                     portFormatType->eEncoding = OMX_AUDIO_CodingAMR;
                 } else
                 {
@@ -2874,7 +2874,7 @@
                 {
                     memcpy(&m_pcm_param,pcmparam,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
-                    DEBUG_PRINT("set_pcm_parameter: %lu %lu",\
+                    DEBUG_PRINT("set_pcm_parameter: %u %u",\
                                  m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
                 } else
@@ -2952,7 +2952,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == volume->nPortIndex)
                 {
-                    volume->nSize = sizeof(volume);
+                    volume->nSize = (OMX_U32)sizeof(volume);
                     volume->nVersion.nVersion = OMX_SPEC_VERSION;
                     volume->bLinear = OMX_TRUE;
                     volume->sVolume.nValue = m_volume;
@@ -2972,7 +2972,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == mute->nPortIndex)
                 {
-                    mute->nSize = sizeof(mute);
+                    mute->nSize = (OMX_U32)sizeof(mute);
                     mute->nVersion.nVersion = OMX_SPEC_VERSION;
                     mute->bMute = (BITMASK_PRESENT(&m_flags,
                                       OMX_COMPONENT_MUTED)?OMX_TRUE:OMX_FALSE);
@@ -3180,8 +3180,8 @@
 
     if((hComp == NULL) || (peerComponent == NULL) || (tunnelSetup == NULL))
     {
-        port = 0;
-        peerPort = 0;
+        port = port;
+        peerPort = peerPort;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3221,7 +3221,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         free(buf_ptr);
         return OMX_ErrorBadParameter;
@@ -3234,7 +3234,7 @@
 
         bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) + sizeof(META_IN)+
                                                sizeof(OMX_BUFFERHEADERTYPE));
-        bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+        bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
         bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
         bufHdr->nAllocLen         = nBufSize;
         bufHdr->pAppPrivate       = appData;
@@ -3243,7 +3243,7 @@
 
         m_inp_current_buf_count++;
         DEBUG_PRINT("AIB:bufHdr %p bufHdr->pBuffer %p m_inp_buf_cnt=%d \
-		bytes=%lu", bufHdr, bufHdr->pBuffer,m_inp_current_buf_count,
+		bytes=%u", bufHdr, bufHdr->pBuffer,m_inp_current_buf_count,
                     bytes);
 
     } else
@@ -3275,7 +3275,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3291,7 +3291,7 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) +
 					sizeof(OMX_BUFFERHEADERTYPE));
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             bufHdr->pAppPrivate       = appData;
@@ -3299,7 +3299,7 @@
             m_output_buf_hdrs.insert(bufHdr, NULL);
             m_out_current_buf_count++;
             DEBUG_PRINT("AOB::bufHdr %p bufHdr->pBuffer %p m_out_buf_cnt=%d"\
-                        "bytes=%lu",bufHdr, bufHdr->pBuffer,\
+                        "bytes=%u",bufHdr, bufHdr->pBuffer,\
                         m_out_current_buf_count, bytes);
         } else
         {
@@ -3513,7 +3513,7 @@
         }
     }
   }
-    DEBUG_PRINT("Use Buffer for port[%lu] eRet[%d]\n", port,eRet);
+    DEBUG_PRINT("Use Buffer for port[%u] eRet[%d]\n", port,eRet);
     return eRet;
 }
 /*=============================================================================
@@ -3556,7 +3556,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3578,8 +3578,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_input_buffer:bufHdr %p bufHdr->pBuffer %p \
-			bytes=%lu", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			bytes=%u", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             input_buffer_size         = nBufSize;
@@ -3641,7 +3641,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3667,8 +3667,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_output_buffer:bufHdr %p bufHdr->pBuffer %p \
-			len=%lu", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			len=%u", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             output_buffer_size        = nBufSize;
@@ -3767,7 +3767,7 @@
                (m_out_bEnabled == OMX_FALSE &&
 		port == OMX_CORE_OUTPUT_PORT_INDEX))
     {
-        DEBUG_PRINT("Free Buffer while port %lu disabled\n", port);
+        DEBUG_PRINT("Free Buffer while port %u disabled\n", port);
     } else if (m_state == OMX_StateExecuting || m_state == OMX_StatePause)
     {
         DEBUG_PRINT("Invalid state to free buffer,ports need to be disabled:\
@@ -3901,7 +3901,7 @@
 {
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
 
-    DEBUG_PRINT("ETB:Buf:%p Len %lu TS %lld numInBuf=%d\n", \
+    DEBUG_PRINT("ETB:Buf:%p Len %u TS %lld numInBuf=%d\n", \
                 buffer, buffer->nFilledLen, buffer->nTimeStamp, (nNumInputBuf));
     if (m_state == OMX_StateInvalid)
     {
@@ -3939,11 +3939,11 @@
     {
         if (search_input_bufhdr(buffer) == true)
         {
-            post_input((unsigned)hComp,
-                       (unsigned) buffer,OMX_COMPONENT_GENERATE_ETB);
+            post_input((unsigned long)hComp,
+                       (unsigned long) buffer,OMX_COMPONENT_GENERATE_ETB);
         } else
         {
-            DEBUG_PRINT_ERROR("Bad header %x \n", (int)buffer);
+            DEBUG_PRINT_ERROR("Bad header %p \n", buffer);
             eRet = OMX_ErrorBadParameter;
         }
     }
@@ -3985,11 +3985,11 @@
         data = m_tmp_meta_buf;
 
         // copy the metadata info from the BufHdr and insert to payload
-        meta_in.offsetVal  = sizeof(META_IN);
+        meta_in.offsetVal  = (OMX_U16)sizeof(META_IN);
         meta_in.nTimeStamp.LowPart =
-           ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
+          (unsigned int)((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
         meta_in.nTimeStamp.HighPart =
-           (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
+          (unsigned int) (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
         meta_in.nFlags &= ~OMX_BUFFERFLAG_EOS;
         if(buffer->nFlags & OMX_BUFFERFLAG_EOS)
         {
@@ -4016,7 +4016,7 @@
         /* Assume empty this buffer function has already checked
         validity of buffer */
         DEBUG_PRINT("Empty buffer %p to kernel driver\n", buffer);
-        post_input((unsigned) & hComp,(unsigned) buffer,
+        post_input((unsigned long) & hComp,(unsigned long) buffer,
                    OMX_COMPONENT_GENERATE_BUFFER_DONE);
     }
     return OMX_ErrorNone;
@@ -4029,7 +4029,7 @@
 {
     OMX_STATETYPE state;
     ENC_META_OUT *meta_out = NULL;
-    int nReadbytes = 0;
+    ssize_t nReadbytes = 0;
 
     pthread_mutex_lock(&m_state_lock);
     get_state(&m_cmp, &state);
@@ -4059,8 +4059,9 @@
           buffer->nTimeStamp = (((OMX_TICKS)meta_out->msw_ts << 32)+
 					meta_out->lsw_ts);
           buffer->nFlags |= meta_out->nflags;
-          buffer->nOffset =  meta_out->offset_to_frame + sizeof(unsigned char);
-          buffer->nFilledLen = nReadbytes - buffer->nOffset;
+          buffer->nOffset = (OMX_U32)(meta_out->offset_to_frame +
+                                    sizeof(unsigned char));
+          buffer->nFilledLen = (OMX_U32)(nReadbytes - buffer->nOffset);
           ts += FRAMEDURATION;
           buffer->nTimeStamp = ts;
           nTimestamp = buffer->nTimeStamp;
@@ -4095,7 +4096,7 @@
           {
               DEBUG_PRINT("FTBP:Post the FBD to event thread currstate=%d\n",\
                             state);
-              post_output((unsigned) & hComp,(unsigned) buffer,
+              post_output((unsigned long) & hComp,(unsigned long) buffer,
                             OMX_COMPONENT_GENERATE_FRAME_DONE);
           }
           else
@@ -4160,8 +4161,8 @@
     m_amr_pb_stats.ftb_cnt++;
     DEBUG_DETAIL("FTB:nNumOutputBuf is %d", nNumOutputBuf);
     pthread_mutex_unlock(&out_buf_count_lock);
-    post_output((unsigned)hComp,
-                (unsigned) buffer,OMX_COMPONENT_GENERATE_FTB);
+    post_output((unsigned long)hComp,
+                (unsigned long) buffer,OMX_COMPONENT_GENERATE_FTB);
     return eRet;
 }
 
@@ -4244,11 +4245,11 @@
 {
     DEBUG_PRINT("Component-deinit being processed\n");
     DEBUG_PRINT("********************************\n");
-    DEBUG_PRINT("STATS: in-buf-len[%lu]out-buf-len[%lu] tot-pb-time[%ld]",\
+    DEBUG_PRINT("STATS: in-buf-len[%u]out-buf-len[%u] tot-pb-time[%lld]",\
                 m_amr_pb_stats.tot_in_buf_len,
                 m_amr_pb_stats.tot_out_buf_len,
                 m_amr_pb_stats.tot_pb_time);
-    DEBUG_PRINT("STATS: fbd-cnt[%lu]ftb-cnt[%lu]etb-cnt[%lu]ebd-cnt[%lu]",\
+    DEBUG_PRINT("STATS: fbd-cnt[%u]ftb-cnt[%u]etb-cnt[%u]ebd-cnt[%u]",\
                 m_amr_pb_stats.fbd_cnt,m_amr_pb_stats.ftb_cnt,
                 m_amr_pb_stats.etb_cnt,
                 m_amr_pb_stats.ebd_cnt);
@@ -4390,8 +4391,8 @@
 
     if((hComp == NULL) || (appData == NULL) || (eglImage == NULL))
     {
-        bufferHdr = NULL;
-        port = 0;
+        bufferHdr = bufferHdr;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -4425,8 +4426,8 @@
     }
     if (index == 0 && role)
     {
-        memcpy(role, cmp_role, sizeof(cmp_role));
-        *(((char *) role) + sizeof(cmp_role)) = '\0';
+        memcpy(role, cmp_role, strlen(cmp_role));
+        *(((char *) role) + strlen(cmp_role) +1) = '\0';
     } else
     {
         eRet = OMX_ErrorNoMore;
diff --git a/mm-audio/aenc-amrnb/qdsp6/test/omx_amr_enc_test.c b/mm-audio/aenc-amrnb/qdsp6/test/omx_amr_enc_test.c
index a3c91b1..e509748 100644
--- a/mm-audio/aenc-amrnb/qdsp6/test/omx_amr_enc_test.c
+++ b/mm-audio/aenc-amrnb/qdsp6/test/omx_amr_enc_test.c
@@ -1,6 +1,6 @@
 
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -84,8 +84,8 @@
 uint32_t channels = 1;
 uint32_t bandmode = 7;
 uint32_t dtxenable = 0;
-uint32_t rectime = -1;
-uint32_t recpath = -1;
+uint32_t rectime = 0;
+uint32_t recpath = 0;
 uint32_t pcmplayback = 0;
 uint32_t tunnel      = 0;
 uint32_t format = 1;
@@ -208,14 +208,14 @@
         unsigned int s_data;
 } __attribute__ ((packed));
 
-static unsigned totaldatalen = 0;
-static unsigned framecnt = 0;
+static int totaldatalen = 0;
+static int framecnt = 0;
 /************************************************************************/
 /*                GLOBAL INIT                    */
 /************************************************************************/
 
-int input_buf_cnt = 0;
-int output_buf_cnt = 0;
+unsigned int input_buf_cnt = 0;
+unsigned int output_buf_cnt = 0;
 int used_ip_buf_cnt = 0;
 volatile int event_is_done = 0;
 volatile int ebd_event_is_done = 0;
@@ -256,7 +256,7 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *amr_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize);
+                                       unsigned int bufCntMin, unsigned int bufSize);
 
 
 static OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
@@ -329,7 +329,7 @@
     (void)pEventData;
     switch(eEvent) {
         case OMX_EventCmdComplete:
-        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%lu data2=%lu\n",(OMX_EVENTTYPE)eEvent,
+        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%u data2=%u\n",(OMX_EVENTTYPE)eEvent,
                                                                                nData1,nData2);
             event_complete();
         break;
@@ -356,8 +356,8 @@
                               OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
 {
     size_t bytes_writen = 0;
-    int total_bytes_writen = 0;
-    unsigned int len = 0;
+    size_t total_bytes_writen = 0;
+    size_t len = 0;
     struct enc_meta_out *meta = NULL;
     OMX_U8 *src = pBuffer->pBuffer;
     unsigned int num_of_frames = 1;
@@ -404,8 +404,8 @@
             num_of_frames--;
             total_bytes_writen += len;
         }
-        DEBUG_PRINT(" FillBufferDone size writen to file  %d count %d\n",total_bytes_writen, framecnt);
-        totaldatalen += total_bytes_writen ;
+        DEBUG_PRINT(" FillBufferDone size writen to file  %zu count %d\n",total_bytes_writen, framecnt);
+        totaldatalen = totaldatalen + (int)total_bytes_writen;
     framecnt++;
 
         DEBUG_PRINT(" FBD calling FTB\n");
@@ -457,7 +457,7 @@
     }
 
     if((readBytes = Read_Buffer(pBuffer)) > 0) {
-        pBuffer->nFilledLen = readBytes;
+        pBuffer->nFilledLen = (OMX_U32)readBytes;
         used_ip_buf_cnt++;
         OMX_EmptyThisBuffer(hComponent,pBuffer);
     }
@@ -494,7 +494,7 @@
 
 int main(int argc, char **argv)
 {
-     int bufCnt=0;
+     unsigned int bufCnt=0;
      OMX_ERRORTYPE result;
 
     struct sigaction sa;
@@ -516,11 +516,11 @@
     if (argc >= 8) {
         in_filename = argv[1];
           out_filename = argv[2];
-    tunnel =  atoi(argv[3]);
-        bandmode  = atoi(argv[4]);
-        dtxenable  = atoi(argv[5]);
-        recpath      = atoi(argv[6]); // No configuration support yet..
-        rectime      = atoi(argv[7]);
+    tunnel =  (uint32_t)atoi(argv[3]);
+        bandmode  = (uint32_t)atoi(argv[4]);
+        dtxenable  = (uint32_t)atoi(argv[5]);
+        recpath      = (uint32_t)atoi(argv[6]); // No configuration support yet..
+        rectime      = (uint32_t)atoi(argv[7]);
 
     } else {
           DEBUG_PRINT(" invalid format: \n");
@@ -690,7 +690,7 @@
     /* Query for audio decoders*/
     DEBUG_PRINT("Amr_test: Before entering OMX_GetComponentOfRole");
     OMX_GetComponentsOfRole(role, &total, 0);
-    DEBUG_PRINT ("\nTotal components of role=%s :%lu", role, total);
+    DEBUG_PRINT ("\nTotal components of role=%s :%u", role, total);
 
 
     omxresult = OMX_GetHandle((OMX_HANDLETYPE*)(&amr_enc_handle),
@@ -715,8 +715,8 @@
     }
     else
     {
-        DEBUG_PRINT("\nportParam.nPorts:%lu\n", portParam.nPorts);
-    DEBUG_PRINT("\nportParam.nStartPortNumber:%lu\n",
+        DEBUG_PRINT("\nportParam.nPorts:%u\n", portParam.nPorts);
+    DEBUG_PRINT("\nportParam.nStartPortNumber:%u\n",
                                              portParam.nStartPortNumber);
     }
 
@@ -730,12 +730,16 @@
 
 int Play_Encoder()
 {
-    int i;
+    unsigned int i;
     int Size=0;
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE ret;
     OMX_INDEXTYPE index;
+#ifdef __LP64__
+    DEBUG_PRINT("sizeof[%ld]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#else
     DEBUG_PRINT("sizeof[%d]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#endif
 
     /* open the i/p and o/p files based on the video file format passed */
     if(open_audio_file()) {
@@ -750,8 +754,8 @@
     inputportFmt.nPortIndex = portParam.nStartPortNumber;
 
     OMX_GetParameter(amr_enc_handle,OMX_IndexParamPortDefinition,&inputportFmt);
-    DEBUG_PRINT ("\nEnc Input Buffer Count %lu\n", inputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Input Buffer Size %lu\n", inputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc Input Buffer Count %u\n", inputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Input Buffer Size %u\n", inputportFmt.nBufferSize);
 
     if(OMX_DirInput != inputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Input Port\n");
@@ -770,8 +774,8 @@
     outputportFmt.nPortIndex = portParam.nStartPortNumber + 1;
 
     OMX_GetParameter(amr_enc_handle,OMX_IndexParamPortDefinition,&outputportFmt);
-    DEBUG_PRINT ("\nEnc: Output Buffer Count %lu\n", outputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Output Buffer Size %lu\n", outputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc: Output Buffer Count %u\n", outputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Output Buffer Size %u\n", outputportFmt.nBufferSize);
 
     if(OMX_DirOutput != outputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Output Port\n");
@@ -861,7 +865,7 @@
     for(i=0; i < output_buf_cnt; i++) {
         DEBUG_PRINT ("\nOMX_FillThisBuffer on output buf no.%d\n",i);
         pOutputBufHdrs[i]->nOutputPortIndex = 1;
-        pOutputBufHdrs[i]->nFlags &= ~OMX_BUFFERFLAG_EOS;
+        pOutputBufHdrs[i]->nFlags = pOutputBufHdrs[i]->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
         ret = OMX_FillThisBuffer(amr_enc_handle, pOutputBufHdrs[i]);
         if (OMX_ErrorNone != ret) {
             DEBUG_PRINT("OMX_FillThisBuffer failed with result %d\n", ret);
@@ -883,7 +887,7 @@
           bInputEosReached = true;
           pInputBufHdrs[i]->nFlags= OMX_BUFFERFLAG_EOS;
         }
-        pInputBufHdrs[i]->nFilledLen = Size;
+        pInputBufHdrs[i]->nFilledLen = (OMX_U32)Size;
         pInputBufHdrs[i]->nInputPortIndex = 0;
         used_ip_buf_cnt++;
         ret = OMX_EmptyThisBuffer(amr_enc_handle, pInputBufHdrs[i]);
@@ -921,11 +925,11 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *avc_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize)
+                                       unsigned int bufCntMin, unsigned int bufSize)
 {
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE error=OMX_ErrorNone;
-    long bufCnt=0;
+    unsigned int bufCnt=0;
 
     /* To remove warning for unused variable to keep prototype same */
     (void)avc_enc_handle;
@@ -933,7 +937,7 @@
                    malloc(sizeof(OMX_BUFFERHEADERTYPE*)*bufCntMin);
 
     for(bufCnt=0; bufCnt < bufCntMin; ++bufCnt) {
-        DEBUG_PRINT("\n OMX_AllocateBuffer No %ld \n", bufCnt);
+        DEBUG_PRINT("\n OMX_AllocateBuffer No %d \n", bufCnt);
         error = OMX_AllocateBuffer(amr_enc_handle, &((*pBufHdrs)[bufCnt]),
                                    nPortIndex, NULL, bufSize);
     }
@@ -947,7 +951,7 @@
 static int Read_Buffer (OMX_BUFFERHEADERTYPE  *pBufHdr )
 {
 
-    int bytes_read=0;
+    size_t bytes_read=0;
 
 
     pBufHdr->nFilledLen = 0;
@@ -955,11 +959,11 @@
 
      bytes_read = fread(pBufHdr->pBuffer, 1, pBufHdr->nAllocLen , inputBufferFile);
 
-      pBufHdr->nFilledLen = bytes_read;
+      pBufHdr->nFilledLen = (OMX_U32)bytes_read;
       // Time stamp logic
     ((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp = \
 
-    (unsigned long) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
+    (OMX_TICKS) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
 
        DEBUG_PRINT ("\n--time stamp -- %ld\n",  (unsigned long)((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp);
         if(bytes_read == 0)
@@ -969,12 +973,12 @@
         }
         else
         {
-            pBufHdr->nFlags &= ~OMX_BUFFERFLAG_EOS;
+            pBufHdr->nFlags = pBufHdr->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
 
-            total_pcm_bytes += bytes_read;
+            total_pcm_bytes = (unsigned)(total_pcm_bytes + bytes_read);
         }
 
-    return bytes_read;;
+    return (int)bytes_read;;
 }
 
 
diff --git a/mm-audio/aenc-evrc/Android.mk b/mm-audio/aenc-evrc/Android.mk
index 649f860..09c9ebd 100644
--- a/mm-audio/aenc-evrc/Android.mk
+++ b/mm-audio/aenc-evrc/Android.mk
@@ -1,5 +1,4 @@
-ifeq ($(TARGET_ARCH),arm)
-
+ifneq ($(filter arm aarch64 arm64, $(TARGET_ARCH)),)
 
 AENC_EVRC_PATH:= $(call my-dir)
 
@@ -27,5 +26,8 @@
 ifeq ($(call is-board-platform,msm8916),true)
 include $(AENC_EVRC_PATH)/qdsp6/Android.mk
 endif
+ifeq ($(call is-board-platform,msm8994),true)
+include $(AENC_EVRC_PATH)/qdsp6/Android.mk
+endif
 
 endif
diff --git a/mm-audio/aenc-evrc/qdsp6/Android.mk b/mm-audio/aenc-evrc/qdsp6/Android.mk
index d38d004..98d95b1 100644
--- a/mm-audio/aenc-evrc/qdsp6/Android.mk
+++ b/mm-audio/aenc-evrc/qdsp6/Android.mk
@@ -13,6 +13,7 @@
 libOmxEvrcEnc-def += -D_ENABLE_QC_MSG_LOG_
 libOmxEvrcEnc-def += -DVERBOSE
 libOmxEvrcEnc-def += -D_DEBUG
+libOmxEvrcEnc-def += -Wconversion
 ifeq ($(strip $(TARGET_USES_QCOM_MM_AUDIO)),true)
 libOmxEvrcEnc-def += -DAUDIOV2
 endif
diff --git a/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h b/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
index fa83230..09ffb2d 100644
--- a/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
+++ b/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010,2014 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -81,10 +81,10 @@
 
 
 #define PrintFrameHdr(i,bufHdr) \
-                           DEBUG_PRINT("i=%d OMX bufHdr[%x]buf[%x]size[%d]TS[%lld]nFlags[0x%x]\n",\
+                           DEBUG_PRINT("i=%d OMX bufHdr[%p]buf[%p]size[%d]TS[%lld]nFlags[0x%x]\n",\
                            i,\
-                           (unsigned) bufHdr,                                     \
-                           (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
+                           bufHdr,                                     \
+                           ((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFilledLen,\
                            ((OMX_BUFFERHEADERTYPE *)bufHdr)->nTimeStamp, \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFlags)
@@ -245,7 +245,7 @@
                                 void *                  eglImage);
 
     bool post_command(unsigned int p1, unsigned int p2,
-        unsigned int id);
+        unsigned char id);
 
     // Deferred callback identifiers
     enum
@@ -304,9 +304,9 @@
 
     struct omx_event
     {
-        unsigned param1;
-        unsigned param2;
-        unsigned id;
+        unsigned long param1;
+        unsigned long param2;
+        unsigned char id;
     };
 
     struct omx_cmd_queue
@@ -318,16 +318,16 @@
 
         omx_cmd_queue();
         ~omx_cmd_queue();
-        bool insert_entry(unsigned p1, unsigned p2, unsigned id);
-        bool pop_entry(unsigned *p1,unsigned *p2, unsigned *id);
-        bool get_msg_id(unsigned *id);
-        bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned id);
+        bool insert_entry(unsigned long p1, unsigned long p2, unsigned char id);
+        bool pop_entry(unsigned long *p1,unsigned long *p2, unsigned char *id);
+        bool get_msg_id(unsigned char *id);
+        bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned char id);
     };
 
     typedef struct TIMESTAMP
     {
-        unsigned long LowPart;
-        unsigned long HighPart;
+        unsigned int LowPart;
+        unsigned int HighPart;
     }__attribute__((packed)) TIMESTAMP;
 
     typedef struct metadata_input
@@ -351,7 +351,7 @@
     {
         OMX_U32 tot_in_buf_len;
         OMX_U32 tot_out_buf_len;
-        OMX_U32 tot_pb_time;
+        OMX_TICKS tot_pb_time;
         OMX_U32 fbd_cnt;
         OMX_U32 ftb_cnt;
         OMX_U32 etb_cnt;
@@ -376,7 +376,7 @@
     bool                           is_in_th_sleep;
     bool                           is_out_th_sleep;
     unsigned int                   m_flags;      //encapsulate the waiting states.
-    unsigned int                   nTimestamp;
+    OMX_TICKS                      nTimestamp;
     unsigned int                   pcm_input; //tunnel or non-tunnel
     unsigned int                   m_inp_act_buf_count;    // Num of Input Buffers
     unsigned int                   m_out_act_buf_count;    // Numb of Output Buffers
@@ -508,11 +508,11 @@
 
     bool search_output_bufhdr(OMX_BUFFERHEADERTYPE *buffer);
 
-    bool post_input(unsigned int p1, unsigned int p2,
-                    unsigned int id);
+    bool post_input(unsigned long p1, unsigned long p2,
+                    unsigned char id);
 
-    bool post_output(unsigned int p1, unsigned int p2,
-                     unsigned int id);
+    bool post_output(unsigned long p1, unsigned long p2,
+                     unsigned char id);
 
     void process_events(omx_evrc_aenc *client_data);
 
diff --git a/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp b/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
index 073f1ac..d19320f 100644
--- a/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
+++ b/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -57,9 +57,9 @@
 }
 
 // omx cmd queue insert
-bool omx_evrc_aenc::omx_cmd_queue::insert_entry(unsigned p1,
-                                                unsigned p2,
-                                                unsigned id)
+bool omx_evrc_aenc::omx_cmd_queue::insert_entry(unsigned long p1,
+                                                unsigned long p2,
+                                                unsigned char id)
 {
     bool ret = true;
     if (m_size < OMX_CORE_CONTROL_CMDQ_SIZE)
@@ -81,8 +81,8 @@
     return ret;
 }
 
-bool omx_evrc_aenc::omx_cmd_queue::pop_entry(unsigned *p1,
-                                             unsigned *p2, unsigned *id)
+bool omx_evrc_aenc::omx_cmd_queue::pop_entry(unsigned long *p1,
+                                 unsigned long *p2, unsigned char *id)
 {
     bool ret = true;
     if (m_size > 0)
@@ -111,7 +111,7 @@
 {
     return(new omx_evrc_aenc);
 }
-bool omx_evrc_aenc::omx_cmd_queue::get_msg_id(unsigned *id)
+bool omx_evrc_aenc::omx_cmd_queue::get_msg_id(unsigned char *id)
 {
    if(m_size > 0)
    {
@@ -256,7 +256,10 @@
         m_tmp_out_meta_buf(NULL),
         m_flush_cnt(255),
         m_comp_deinit(0),
+        m_volume(25),
         m_app_data(NULL),
+        nNumInputBuf(0),
+        nNumOutputBuf(0),
         m_drv_fd(-1),
         bFlushinprogress(0),
         is_in_th_sleep(false),
@@ -267,7 +270,7 @@
         m_out_act_buf_count (OMX_CORE_NUM_OUTPUT_BUFFERS),
         m_inp_current_buf_count(0),
         m_out_current_buf_count(0),
-        output_buffer_size(OMX_EVRC_OUTPUT_BUFFER_SIZE),
+        output_buffer_size((OMX_U32)OMX_EVRC_OUTPUT_BUFFER_SIZE),
         input_buffer_size(OMX_CORE_INPUT_BUFFER_SIZE),
         m_inp_bEnabled(OMX_TRUE),
         m_out_bEnabled(OMX_TRUE),
@@ -277,10 +280,7 @@
         m_state(OMX_StateInvalid),
         m_ipc_to_in_th(NULL),
         m_ipc_to_out_th(NULL),
-        m_ipc_to_cmd_th(NULL),
-        nNumOutputBuf(0),
-        nNumInputBuf(0),
-        m_volume(25)
+        m_ipc_to_cmd_th(NULL)
 {
     int cond_ret = 0;
     memset(&m_cmp, 0, sizeof(m_cmp));
@@ -500,13 +500,13 @@
         m_evrc_pb_stats.fbd_cnt++;
         pthread_mutex_lock(&out_buf_count_lock);
         nNumOutputBuf--;
-        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%lu fbd_cnt=%lu\n",\
+        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%u fbd_cnt=%u\n",\
                     nNumOutputBuf,
                     m_evrc_pb_stats.tot_out_buf_len,
                     m_evrc_pb_stats.fbd_cnt);
         m_evrc_pb_stats.tot_out_buf_len += bufHdr->nFilledLen;
         m_evrc_pb_stats.tot_pb_time     = bufHdr->nTimeStamp;
-        DEBUG_PRINT("FBD:in_buf_len=%lu out_buf_len=%lu\n",
+        DEBUG_PRINT("FBD:in_buf_len=%u out_buf_len=%u\n",
                     m_evrc_pb_stats.tot_in_buf_len,
                     m_evrc_pb_stats.tot_out_buf_len);
 
@@ -540,9 +540,9 @@
 =============================================================================*/
 void omx_evrc_aenc::process_out_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;                 // qsize
     unsigned      tot_qsize = 0;
     omx_evrc_aenc  *pThis    = (omx_evrc_aenc *) client_data;
@@ -744,9 +744,9 @@
 =============================================================================*/
 void omx_evrc_aenc::process_command_msg(void *client_data, unsigned char id)
 {
-    unsigned     p1;                             // Parameter - 1
-    unsigned     p2;                             // Parameter - 2
-    unsigned     ident;
+    unsigned long p1 = 0;                             // Parameter - 1
+    unsigned long p2 = 0;                             // Parameter - 2
+    unsigned char ident = 0;
     unsigned     qsize  = 0;
     omx_evrc_aenc *pThis = (omx_evrc_aenc*)client_data;
     pthread_mutex_lock(&pThis->m_commandlock);
@@ -818,15 +818,15 @@
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventError,
-                                         p2,
-                                         NULL,
-                                         NULL );
+                                         (OMX_U32)p2,
+                                         0,
+                                         0 );
             } else
             {
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventCmdComplete,
-                                         p1, p2, NULL );
+                                         (OMX_U32)p1, (OMX_U32)p2, NULL );
             }
         } else
         {
@@ -874,9 +874,9 @@
 =============================================================================*/
 void omx_evrc_aenc::process_in_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;
     unsigned      tot_qsize = 0;
     omx_evrc_aenc  *pThis    = (omx_evrc_aenc *) client_data;
@@ -1054,7 +1054,7 @@
     randomly assign the value right now. Query will result in
     incorrect param */
     memset(&m_evrc_param, 0, sizeof(m_evrc_param));
-    m_evrc_param.nSize = sizeof(m_evrc_param);
+    m_evrc_param.nSize = (OMX_U32)sizeof(m_evrc_param);
     m_evrc_param.nChannels = OMX_EVRC_DEFAULT_CH_CFG;
     //Current DSP does not have config
     m_evrc_param.eCDMARate = OMX_AUDIO_CDMARateFull;
@@ -1063,7 +1063,7 @@
     m_volume = OMX_EVRC_DEFAULT_VOL;             /* Close to unity gain */
     memset(&m_evrc_pb_stats,0,sizeof(EVRC_PB_STATS));
     memset(&m_pcm_param, 0, sizeof(m_pcm_param));
-    m_pcm_param.nSize = sizeof(m_pcm_param);
+    m_pcm_param.nSize = (OMX_U32)sizeof(m_pcm_param);
     m_pcm_param.nChannels = OMX_EVRC_DEFAULT_CH_CFG;
     m_pcm_param.nSamplingRate = OMX_EVRC_DEFAULT_SF;
     nTimestamp = 0;
@@ -1094,20 +1094,20 @@
     if (!strcmp(role,"OMX.qcom.audio.encoder.evrc"))
     {
         pcm_input = 1;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole,
 		(const char*)role, sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else if (!strcmp(role,"OMX.qcom.audio.encoder.tunneled.evrc"))
     {
         pcm_input = 0;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole,
 		(const char*)role, sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else
     {
-        component_Role.nSize = sizeof("\0");
+        component_Role.nSize = (OMX_U32)sizeof("\0");
         strlcpy((char *)component_Role.cRole,
 		(const char*)"\0",sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED is invalid\n", role);
@@ -1253,7 +1253,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1267,7 +1267,7 @@
     }
     post_command((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
     DEBUG_PRINT("Send Command : returns with OMX_ErrorNone \n");
-    DEBUG_PRINT("send_command : recieved state before semwait= %lu\n",param1);
+    DEBUG_PRINT("send_command : recieved state before semwait= %u\n",param1);
     sem_wait (&sem_States);
     DEBUG_PRINT("send_command : recieved state after semwait\n");
     return OMX_ErrorNone;
@@ -1297,7 +1297,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1462,7 +1462,7 @@
                     }
                     pcm_cfg.channel_count = m_pcm_param.nChannels;
                     pcm_cfg.sample_rate  =  m_pcm_param.nSamplingRate;
-                    DEBUG_PRINT("pcm config %lu %lu\n",m_pcm_param.nChannels,
+                    DEBUG_PRINT("pcm config %u %u\n",m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
 
                     if (ioctl(m_drv_fd, AUDIO_SET_CONFIG, &pcm_cfg) == -1)
@@ -1725,7 +1725,7 @@
     } else if (OMX_CommandFlush == cmd)
     {
         DEBUG_DETAIL("*************************\n");
-        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%lu\n",param1);
+        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%u\n",param1);
         DEBUG_DETAIL("*************************\n");
         bFlag = 0;
         if ( param1 == OMX_CORE_INPUT_PORT_INDEX ||
@@ -1764,7 +1764,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable in "\
-                                " param1=%lu m_state=%d \n",param1, m_state);
+                                " param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 DEBUG_PRINT("send_command_proxy:OMX_CommandPortDisable:\
@@ -1796,7 +1796,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable out "\
-                                "param1=%lu m_state=%d \n",param1, m_state);
+                                "param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 BITMASK_SET(&m_flags, OMX_COMPONENT_OUTPUT_DISABLE_PENDING);
@@ -1913,7 +1913,7 @@
 {
     bool bRet = true;
 
-    DEBUG_PRINT("Execute_omx_flush Port[%lu]", param1);
+    DEBUG_PRINT("Execute_omx_flush Port[%u]", param1);
     struct timespec abs_timeout;
     abs_timeout.tv_sec = 1;
     abs_timeout.tv_nsec = 0;
@@ -1963,7 +1963,7 @@
         DEBUG_DETAIL("WAITING FOR FLUSH ACK's param1=%d",param1);
         wait_for_event();
 
-        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%lu cmd_cmpl=%d",\
+        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%u cmd_cmpl=%d",\
                     param1,cmd_cmpl);
 
         // If not going to idle state, Send FLUSH complete message
@@ -2077,7 +2077,7 @@
         DEBUG_DETAIL("RECIEVED FLUSH ACK FOR O/P PORT param1=%d",param1);
     } else
     {
-        DEBUG_PRINT("Invalid Port ID[%lu]",param1);
+        DEBUG_PRINT("Invalid Port ID[%u]",param1);
     }
     return bRet;
 }
@@ -2105,9 +2105,9 @@
 bool omx_evrc_aenc::execute_input_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2185,9 +2185,9 @@
 bool omx_evrc_aenc::execute_output_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1;                            // Parameter - 1
+    unsigned long p2;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2268,9 +2268,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_evrc_aenc::post_input(unsigned int p1,
-                               unsigned int p2,
-                               unsigned int id)
+bool omx_evrc_aenc::post_input(unsigned long p1,
+                               unsigned long p2,
+                               unsigned char id)
 {
     bool bRet = false;
     pthread_mutex_lock(&m_lock);
@@ -2331,7 +2331,7 @@
 =============================================================================*/
 bool omx_evrc_aenc::post_command(unsigned int p1,
                                  unsigned int p2,
-                                 unsigned int id)
+                                 unsigned char id)
 {
     bool bRet  = false;
 
@@ -2378,9 +2378,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_evrc_aenc::post_output(unsigned int p1,
-                                unsigned int p2,
-                                unsigned int id)
+bool omx_evrc_aenc::post_output(unsigned long p1,
+                                unsigned long p2,
+                                unsigned char id)
 {
     bool bRet = false;
 
@@ -2444,7 +2444,7 @@
         return OMX_ErrorBadParameter;
     }
 
-    switch (paramIndex)
+    switch ((int)paramIndex)
     {
         case OMX_IndexParamPortDefinition:
             {
@@ -2452,11 +2452,11 @@
                 portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
 
                 DEBUG_PRINT("OMX_IndexParamPortDefinition " \
-                            "portDefn->nPortIndex = %lu\n",
+                            "portDefn->nPortIndex = %u\n",
 				portDefn->nPortIndex);
 
                 portDefn->nVersion.nVersion = OMX_SPEC_VERSION;
-                portDefn->nSize = sizeof(portDefn);
+                portDefn->nSize = (OMX_U32)sizeof(portDefn);
                 portDefn->eDomain    = OMX_PortDomainAudio;
 
                 if (0 == portDefn->nPortIndex)
@@ -2498,7 +2498,7 @@
                 DEBUG_PRINT("OMX_IndexParamAudioInit\n");
 
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 2;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2510,7 +2510,7 @@
                 (OMX_AUDIO_PARAM_PORTFORMATTYPE *) paramData;
                 DEBUG_PRINT("OMX_IndexParamAudioPortFormat\n");
                 portFormatType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portFormatType->nSize = sizeof(portFormatType);
+                portFormatType->nSize = (OMX_U32)sizeof(portFormatType);
 
                 if (OMX_CORE_INPUT_PORT_INDEX == portFormatType->nPortIndex)
                 {
@@ -2520,7 +2520,7 @@
 				portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("get_parameter: OMX_IndexParamAudioFormat: "\
-                                "%lu\n", portFormatType->nIndex);
+                                "%u\n", portFormatType->nIndex);
 
             portFormatType->eEncoding = OMX_AUDIO_CodingEVRC;
                 } else
@@ -2554,7 +2554,7 @@
     {
        QOMX_AUDIO_STREAM_INFO_DATA *streaminfoparam =
                (QOMX_AUDIO_STREAM_INFO_DATA *) paramData;
-       streaminfoparam->sessionId = m_session_id;
+       streaminfoparam->sessionId = (OMX_U8)m_session_id;
        break;
     }
 
@@ -2567,9 +2567,9 @@
                 {
                     memcpy(pcmparam,&m_pcm_param,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
-                    DEBUG_PRINT("get_parameter: Sampling rate %lu",\
+                    DEBUG_PRINT("get_parameter: Sampling rate %u",\
                                  pcmparam->nSamplingRate);
-                    DEBUG_PRINT("get_parameter: Number of channels %lu",\
+                    DEBUG_PRINT("get_parameter: Number of channels %u",\
                                  pcmparam->nChannels);
                 } else
                 {
@@ -2594,7 +2594,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamVideoInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2604,7 +2604,7 @@
                 OMX_PRIORITYMGMTTYPE *priorityMgmtType =
                 (OMX_PRIORITYMGMTTYPE*)paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamPriorityMgmt\n");
-                priorityMgmtType->nSize = sizeof(priorityMgmtType);
+                priorityMgmtType->nSize = (OMX_U32)sizeof(priorityMgmtType);
                 priorityMgmtType->nVersion.nVersion = OMX_SPEC_VERSION;
                 priorityMgmtType->nGroupID = m_priority_mgm.nGroupID;
                 priorityMgmtType->nGroupPriority =
@@ -2617,7 +2617,7 @@
                 (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamImageInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2632,7 +2632,7 @@
                 DEBUG_PRINT("get_parameter: \
 				OMX_IndexParamCompBufferSupplier\n");
 
-                bufferSupplierType->nSize = sizeof(bufferSupplierType);
+                bufferSupplierType->nSize = (OMX_U32)sizeof(bufferSupplierType);
                 bufferSupplierType->nVersion.nVersion = OMX_SPEC_VERSION;
                 if (OMX_CORE_INPUT_PORT_INDEX   ==
 				bufferSupplierType->nPortIndex)
@@ -2661,7 +2661,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamOtherInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2759,7 +2759,7 @@
                     return OMX_ErrorIncorrectStateOperation;
                 }
                 DEBUG_PRINT("OMX_IndexParamPortDefinition portDefn->nPortIndex "
-                            "= %lu\n",portDefn->nPortIndex);
+                            "= %u\n",portDefn->nPortIndex);
                 if (OMX_CORE_INPUT_PORT_INDEX == portDefn->nPortIndex)
                 {
                     if ( portDefn->nBufferCountActual >
@@ -2803,10 +2803,10 @@
                 }
                 OMX_PRIORITYMGMTTYPE *priorityMgmtype
                 = (OMX_PRIORITYMGMTTYPE*) paramData;
-                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %lu\n",
+                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %u\n",
                             priorityMgmtype->nGroupID);
 
-                DEBUG_PRINT("set_parameter: priorityMgmtype %lu\n",
+                DEBUG_PRINT("set_parameter: priorityMgmtype %u\n",
                             priorityMgmtype->nGroupPriority);
 
                 m_priority_mgm.nGroupID = priorityMgmtype->nGroupID;
@@ -2828,7 +2828,7 @@
 					portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("set_parameter: OMX_IndexParamAudioFormat:"\
-                                " %lu\n", portFormatType->nIndex);
+                                " %u\n", portFormatType->nIndex);
                     portFormatType->eEncoding = OMX_AUDIO_CodingEVRC;
                 } else
                 {
@@ -2876,7 +2876,7 @@
                 {
                     memcpy(&m_pcm_param,pcmparam,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
-                    DEBUG_PRINT("set_pcm_parameter: %lu %lu",\
+                    DEBUG_PRINT("set_pcm_parameter: %u %u",\
                                  m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
                 } else
@@ -2954,7 +2954,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == volume->nPortIndex)
                 {
-                    volume->nSize = sizeof(volume);
+                    volume->nSize = (OMX_U32)sizeof(volume);
                     volume->nVersion.nVersion = OMX_SPEC_VERSION;
                     volume->bLinear = OMX_TRUE;
                     volume->sVolume.nValue = m_volume;
@@ -2974,7 +2974,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == mute->nPortIndex)
                 {
-                    mute->nSize = sizeof(mute);
+                    mute->nSize = (OMX_U32)sizeof(mute);
                     mute->nVersion.nVersion = OMX_SPEC_VERSION;
                     mute->bMute = (BITMASK_PRESENT(&m_flags,
                                       OMX_COMPONENT_MUTED)?OMX_TRUE:OMX_FALSE);
@@ -3182,8 +3182,8 @@
 
     if((hComp == NULL) || (peerComponent == NULL) || (tunnelSetup == NULL))
     {
-        port = 0;
-        peerPort = 0;
+        port = port;
+        peerPort = peerPort;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3223,7 +3223,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         free(buf_ptr);
         return OMX_ErrorBadParameter;
@@ -3236,7 +3236,7 @@
 
         bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) + sizeof(META_IN)+
                                                sizeof(OMX_BUFFERHEADERTYPE));
-        bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+        bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
         bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
         bufHdr->nAllocLen         = nBufSize;
         bufHdr->pAppPrivate       = appData;
@@ -3245,7 +3245,7 @@
 
         m_inp_current_buf_count++;
         DEBUG_PRINT("AIB:bufHdr %p bufHdr->pBuffer %p m_inp_buf_cnt=%u \
-			bytes=%lu", bufHdr, bufHdr->pBuffer,
+			bytes=%u", bufHdr, bufHdr->pBuffer,
 			m_inp_current_buf_count, bytes);
 
     } else
@@ -3277,7 +3277,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3293,7 +3293,7 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) +
 					sizeof(OMX_BUFFERHEADERTYPE));
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             bufHdr->pAppPrivate       = appData;
@@ -3301,7 +3301,7 @@
             m_output_buf_hdrs.insert(bufHdr, NULL);
             m_out_current_buf_count++;
             DEBUG_PRINT("AOB::bufHdr %p bufHdr->pBuffer %p m_out_buf_cnt=%d "\
-                        "bytes=%lu",bufHdr, bufHdr->pBuffer,\
+                        "bytes=%u",bufHdr, bufHdr->pBuffer,\
                         m_out_current_buf_count, bytes);
         } else
         {
@@ -3515,7 +3515,7 @@
         }
     }
   }
-    DEBUG_PRINT("Use Buffer for port[%lu] eRet[%d]\n", port,eRet);
+    DEBUG_PRINT("Use Buffer for port[%u] eRet[%d]\n", port,eRet);
     return eRet;
 }
 /*=============================================================================
@@ -3558,7 +3558,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3580,8 +3580,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_input_buffer:bufHdr %p bufHdr->pBuffer %p \
-			bytes=%lu", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			bytes=%u", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             input_buffer_size         = nBufSize;
@@ -3643,7 +3643,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3669,8 +3669,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_output_buffer:bufHdr %p bufHdr->pBuffer %p \
-			len=%lu\n", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			len=%u\n", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             output_buffer_size        = nBufSize;
@@ -3769,7 +3769,7 @@
                (m_out_bEnabled == OMX_FALSE &&
 		port == OMX_CORE_OUTPUT_PORT_INDEX))
     {
-        DEBUG_PRINT("Free Buffer while port %lu disabled\n", port);
+        DEBUG_PRINT("Free Buffer while port %u disabled\n", port);
     } else if (m_state == OMX_StateExecuting || m_state == OMX_StatePause)
     {
         DEBUG_PRINT("Invalid state to free buffer,ports need to be disabled:\
@@ -3903,7 +3903,7 @@
 {
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
 
-    DEBUG_PRINT("ETB:Buf:%p Len %lu TS %lld numInBuf=%d\n", \
+    DEBUG_PRINT("ETB:Buf:%p Len %u TS %lld numInBuf=%d\n", \
                 buffer, buffer->nFilledLen, buffer->nTimeStamp, (nNumInputBuf));
     if (m_state == OMX_StateInvalid)
     {
@@ -3941,11 +3941,11 @@
     {
         if (search_input_bufhdr(buffer) == true)
         {
-            post_input((unsigned)hComp,
-                       (unsigned) buffer,OMX_COMPONENT_GENERATE_ETB);
+            post_input((unsigned long)hComp,
+                       (unsigned long) buffer,OMX_COMPONENT_GENERATE_ETB);
         } else
         {
-            DEBUG_PRINT_ERROR("Bad header %x \n", (int)buffer);
+            DEBUG_PRINT_ERROR("Bad header %p \n", buffer);
             eRet = OMX_ErrorBadParameter;
         }
     }
@@ -3987,11 +3987,11 @@
         data = m_tmp_meta_buf;
 
         // copy the metadata info from the BufHdr and insert to payload
-        meta_in.offsetVal  = sizeof(META_IN);
+        meta_in.offsetVal  = (OMX_U16)sizeof(META_IN);
         meta_in.nTimeStamp.LowPart =
-           ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
+          (unsigned int) ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) & 0xFFFFFFFF);
         meta_in.nTimeStamp.HighPart =
-           (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
+          (unsigned int) (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
         meta_in.nFlags &= ~OMX_BUFFERFLAG_EOS;
         if(buffer->nFlags & OMX_BUFFERFLAG_EOS)
         {
@@ -4018,7 +4018,7 @@
         /* Assume empty this buffer function has already checked
         validity of buffer */
         DEBUG_PRINT("Empty buffer %p to kernel driver\n", buffer);
-        post_input((unsigned) & hComp,(unsigned) buffer,
+        post_input((unsigned long) & hComp,(unsigned long) buffer,
                    OMX_COMPONENT_GENERATE_BUFFER_DONE);
     }
     return OMX_ErrorNone;
@@ -4031,7 +4031,7 @@
 {
     OMX_STATETYPE state;
     ENC_META_OUT *meta_out = NULL;
-    int nReadbytes = 0;
+    ssize_t nReadbytes = 0;
 
     pthread_mutex_lock(&m_state_lock);
     get_state(&m_cmp, &state);
@@ -4061,8 +4061,9 @@
           buffer->nTimeStamp = (((OMX_TICKS) meta_out->msw_ts << 32)+
 				meta_out->lsw_ts);
           buffer->nFlags |= meta_out->nflags;
-          buffer->nOffset =  meta_out->offset_to_frame + sizeof(unsigned char);
-          buffer->nFilledLen = nReadbytes - buffer->nOffset;
+          buffer->nOffset =  (OMX_U32)(meta_out->offset_to_frame +
+                                            sizeof(unsigned char));
+          buffer->nFilledLen = (OMX_U32)(nReadbytes - buffer->nOffset);
           nTimestamp = buffer->nTimeStamp;
           DEBUG_PRINT("nflags %d frame_size %d offset_to_frame %d \
 			timestamp %lld\n", meta_out->nflags,
@@ -4096,7 +4097,7 @@
           {
               DEBUG_PRINT("FTBP:Post the FBD to event thread currstate=%d\n",\
                             state);
-              post_output((unsigned) & hComp,(unsigned) buffer,
+              post_output((unsigned long) & hComp,(unsigned long) buffer,
                             OMX_COMPONENT_GENERATE_FRAME_DONE);
           }
           else
@@ -4161,8 +4162,8 @@
     m_evrc_pb_stats.ftb_cnt++;
     DEBUG_DETAIL("FTB:nNumOutputBuf is %d", nNumOutputBuf);
     pthread_mutex_unlock(&out_buf_count_lock);
-    post_output((unsigned)hComp,
-                (unsigned) buffer,OMX_COMPONENT_GENERATE_FTB);
+    post_output((unsigned long)hComp,
+                (unsigned long) buffer,OMX_COMPONENT_GENERATE_FTB);
     return eRet;
 }
 
@@ -4245,11 +4246,11 @@
 {
     DEBUG_PRINT("Component-deinit being processed\n");
     DEBUG_PRINT("********************************\n");
-    DEBUG_PRINT("STATS: in-buf-len[%lu]out-buf-len[%lu] tot-pb-time[%ld]",\
+    DEBUG_PRINT("STATS: in-buf-len[%u]out-buf-len[%u] tot-pb-time[%lld]",\
                 m_evrc_pb_stats.tot_in_buf_len,
                 m_evrc_pb_stats.tot_out_buf_len,
                 m_evrc_pb_stats.tot_pb_time);
-    DEBUG_PRINT("STATS: fbd-cnt[%lu]ftb-cnt[%lu]etb-cnt[%lu]ebd-cnt[%lu]",\
+    DEBUG_PRINT("STATS: fbd-cnt[%u]ftb-cnt[%u]etb-cnt[%u]ebd-cnt[%u]",\
                 m_evrc_pb_stats.fbd_cnt,m_evrc_pb_stats.ftb_cnt,
                 m_evrc_pb_stats.etb_cnt,
                 m_evrc_pb_stats.ebd_cnt);
@@ -4389,8 +4390,8 @@
 
     if((hComp == NULL) || (appData == NULL) || (eglImage == NULL))
     {
-        bufferHdr = NULL;
-        port = 0;
+        bufferHdr = bufferHdr;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -4424,8 +4425,8 @@
     }
     if (index == 0 && role)
     {
-        memcpy(role, cmp_role, sizeof(cmp_role));
-        *(((char *) role) + sizeof(cmp_role)) = '\0';
+        memcpy(role, cmp_role, strlen(cmp_role));
+        *(((char *) role) + strlen(cmp_role) + 1) = '\0';
     } else
     {
         eRet = OMX_ErrorNoMore;
diff --git a/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c b/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c
index e01759e..63d953b 100644
--- a/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c
+++ b/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c
@@ -1,6 +1,6 @@
 
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -85,9 +85,9 @@
 uint32_t min_bitrate = 0;
 uint32_t max_bitrate = 0;
 uint32_t cdmarate = 0;
-uint32_t rectime = -1;
-uint32_t recpath = -1;
-uint32_t pcmplayback = 0;
+uint32_t rectime = 0;
+uint32_t recpath = 0;
+int32_t pcmplayback = 0;
 uint32_t tunnel      = 0;
 uint32_t format = 1;
 #define DEBUG_PRINT printf
@@ -217,14 +217,14 @@
          {'v','r','a','t'},0, 0, 0,{'d','a','t','a'},0
  };
 
-static unsigned totaldatalen = 0;
-static unsigned framecnt = 0;
+static int totaldatalen = 0;
+static int framecnt = 0;
 /************************************************************************/
 /*                GLOBAL INIT                    */
 /************************************************************************/
 
-int input_buf_cnt = 0;
-int output_buf_cnt = 0;
+unsigned int input_buf_cnt = 0;
+unsigned int output_buf_cnt = 0;
 int used_ip_buf_cnt = 0;
 volatile int event_is_done = 0;
 volatile int ebd_event_is_done = 0;
@@ -265,7 +265,7 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *evrc_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize);
+                                       unsigned int bufCntMin, unsigned int bufSize);
 
 
 static OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
@@ -325,7 +325,7 @@
 
 static void create_qcp_header(int Datasize, int Frames)
 {
-        append_header.s_riff = Datasize + QCP_HEADER_SIZE - 8;
+        append_header.s_riff = (unsigned)(Datasize + (int)QCP_HEADER_SIZE - 8);
         /* exclude riff id and size field */
     append_header.data1 = 0xe689d48d;
     append_header.data2 = 0x9076;
@@ -349,8 +349,8 @@
     append_header.vr_bytes_per_pkt[3] = 0x0102;
     append_header.s_vrat = 0x00000008;
     append_header.v_rate = 0x00000001;
-        append_header.size_in_pkts = Frames;
-        append_header.s_data = Datasize;
+        append_header.size_in_pkts = (unsigned)Frames;
+        append_header.s_data = (unsigned)Datasize;
         return;
 }
 
@@ -368,7 +368,7 @@
     (void)pEventData;
     switch(eEvent) {
         case OMX_EventCmdComplete:
-        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%lu data2=%lu\n",(OMX_EVENTTYPE)eEvent,
+        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%u data2=%u\n",(OMX_EVENTTYPE)eEvent,
                                                                                nData1,nData2);
             event_complete();
         break;
@@ -395,8 +395,8 @@
                               OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
 {
     size_t bytes_writen = 0;
-    int total_bytes_writen = 0;
-    unsigned int len = 0;
+    size_t total_bytes_writen = 0;
+    size_t len = 0;
     struct enc_meta_out *meta = NULL;
     OMX_U8 *src = pBuffer->pBuffer;
     unsigned int num_of_frames = 1;
@@ -443,8 +443,8 @@
             num_of_frames--;
             total_bytes_writen += len;
         }
-        DEBUG_PRINT(" FillBufferDone size writen to file  %d count %d\n",total_bytes_writen, framecnt);
-        totaldatalen += total_bytes_writen ;
+        DEBUG_PRINT(" FillBufferDone size writen to file  %zu count %d\n",total_bytes_writen, framecnt);
+        totaldatalen = totaldatalen + (int)total_bytes_writen;
     framecnt++;
 
         DEBUG_PRINT(" FBD calling FTB\n");
@@ -497,7 +497,7 @@
     }
 
     if((readBytes = Read_Buffer(pBuffer)) > 0) {
-        pBuffer->nFilledLen = readBytes;
+        pBuffer->nFilledLen = (OMX_U32)readBytes;
         used_ip_buf_cnt++;
         OMX_EmptyThisBuffer(hComponent,pBuffer);
     }
@@ -534,7 +534,7 @@
 
 int main(int argc, char **argv)
 {
-     int bufCnt=0;
+     unsigned int bufCnt=0;
      OMX_ERRORTYPE result;
 
     struct sigaction sa;
@@ -556,12 +556,12 @@
     if (argc >= 9) {
         in_filename = argv[1];
           out_filename = argv[2];
-    tunnel =  atoi(argv[3]);
-        min_bitrate  = atoi(argv[4]);
-        max_bitrate  = atoi(argv[5]);
-        cdmarate     = atoi(argv[6]);
-        recpath      = atoi(argv[7]); // No configuration support yet..
-        rectime      = atoi(argv[8]);
+    tunnel =  (uint32_t)atoi(argv[3]);
+        min_bitrate  = (uint32_t)atoi(argv[4]);
+        max_bitrate  = (uint32_t)atoi(argv[5]);
+        cdmarate     = (uint32_t)atoi(argv[6]);
+        recpath      = (uint32_t)atoi(argv[7]); // No configuration support yet..
+        rectime      = (uint32_t)atoi(argv[8]);
 
     } else {
           DEBUG_PRINT(" invalid format: \n");
@@ -733,7 +733,7 @@
     /* Query for audio decoders*/
     DEBUG_PRINT("Evrc_test: Before entering OMX_GetComponentOfRole");
     OMX_GetComponentsOfRole(role, &total, 0);
-    DEBUG_PRINT ("\nTotal components of role=%s :%lu", role, total);
+    DEBUG_PRINT ("\nTotal components of role=%s :%u", role, total);
 
 
     omxresult = OMX_GetHandle((OMX_HANDLETYPE*)(&evrc_enc_handle),
@@ -758,8 +758,8 @@
     }
     else
     {
-        DEBUG_PRINT("\nportParam.nPorts:%lu\n", portParam.nPorts);
-    DEBUG_PRINT("\nportParam.nStartPortNumber:%lu\n",
+        DEBUG_PRINT("\nportParam.nPorts:%u\n", portParam.nPorts);
+    DEBUG_PRINT("\nportParam.nStartPortNumber:%u\n",
                                              portParam.nStartPortNumber);
     }
 
@@ -773,12 +773,16 @@
 
 int Play_Encoder()
 {
-    int i;
+    unsigned int i;
     int Size=0;
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE ret;
     OMX_INDEXTYPE index;
+#ifdef __LP64__
+    DEBUG_PRINT("sizeof[%ld]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#else
     DEBUG_PRINT("sizeof[%d]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#endif
 
     /* open the i/p and o/p files based on the video file format passed */
     if(open_audio_file()) {
@@ -793,8 +797,8 @@
     inputportFmt.nPortIndex = portParam.nStartPortNumber;
 
     OMX_GetParameter(evrc_enc_handle,OMX_IndexParamPortDefinition,&inputportFmt);
-    DEBUG_PRINT ("\nEnc Input Buffer Count %lu\n", inputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Input Buffer Size %lu\n", inputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc Input Buffer Count %u\n", inputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Input Buffer Size %u\n", inputportFmt.nBufferSize);
 
     if(OMX_DirInput != inputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Input Port\n");
@@ -813,8 +817,8 @@
     outputportFmt.nPortIndex = portParam.nStartPortNumber + 1;
 
     OMX_GetParameter(evrc_enc_handle,OMX_IndexParamPortDefinition,&outputportFmt);
-    DEBUG_PRINT ("\nEnc: Output Buffer Count %lu\n", outputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Output Buffer Size %lu\n", outputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc: Output Buffer Count %u\n", outputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Output Buffer Size %u\n", outputportFmt.nBufferSize);
 
     if(OMX_DirOutput != outputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Output Port\n");
@@ -904,7 +908,7 @@
     for(i=0; i < output_buf_cnt; i++) {
         DEBUG_PRINT ("\nOMX_FillThisBuffer on output buf no.%d\n",i);
         pOutputBufHdrs[i]->nOutputPortIndex = 1;
-        pOutputBufHdrs[i]->nFlags &= ~OMX_BUFFERFLAG_EOS;
+        pOutputBufHdrs[i]->nFlags = pOutputBufHdrs[i]->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
         ret = OMX_FillThisBuffer(evrc_enc_handle, pOutputBufHdrs[i]);
         if (OMX_ErrorNone != ret) {
             DEBUG_PRINT("OMX_FillThisBuffer failed with result %d\n", ret);
@@ -926,7 +930,7 @@
           bInputEosReached = true;
           pInputBufHdrs[i]->nFlags= OMX_BUFFERFLAG_EOS;
         }
-        pInputBufHdrs[i]->nFilledLen = Size;
+        pInputBufHdrs[i]->nFilledLen = (OMX_U32)Size;
         pInputBufHdrs[i]->nInputPortIndex = 0;
         used_ip_buf_cnt++;
         ret = OMX_EmptyThisBuffer(evrc_enc_handle, pInputBufHdrs[i]);
@@ -964,11 +968,11 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *avc_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize)
+                                       unsigned int bufCntMin, unsigned int bufSize)
 {
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE error=OMX_ErrorNone;
-    long bufCnt=0;
+    unsigned int bufCnt=0;
 
     /* To remove warning for unused variable to keep prototype same */
     (void)avc_enc_handle;
@@ -976,7 +980,7 @@
                    malloc(sizeof(OMX_BUFFERHEADERTYPE*)*bufCntMin);
 
     for(bufCnt=0; bufCnt < bufCntMin; ++bufCnt) {
-        DEBUG_PRINT("\n OMX_AllocateBuffer No %ld \n", bufCnt);
+        DEBUG_PRINT("\n OMX_AllocateBuffer No %d \n", bufCnt);
         error = OMX_AllocateBuffer(evrc_enc_handle, &((*pBufHdrs)[bufCnt]),
                                    nPortIndex, NULL, bufSize);
     }
@@ -990,7 +994,7 @@
 static int Read_Buffer (OMX_BUFFERHEADERTYPE  *pBufHdr )
 {
 
-    int bytes_read=0;
+    size_t bytes_read=0;
 
 
     pBufHdr->nFilledLen = 0;
@@ -998,11 +1002,11 @@
 
      bytes_read = fread(pBufHdr->pBuffer, 1, pBufHdr->nAllocLen , inputBufferFile);
 
-      pBufHdr->nFilledLen = bytes_read;
+      pBufHdr->nFilledLen = (OMX_U32)bytes_read;
       // Time stamp logic
     ((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp = \
 
-    (unsigned long) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
+    (OMX_TICKS) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
 
        DEBUG_PRINT ("\n--time stamp -- %ld\n",  (unsigned long)((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp);
         if(bytes_read == 0)
@@ -1012,12 +1016,12 @@
         }
         else
         {
-            pBufHdr->nFlags &= ~OMX_BUFFERFLAG_EOS;
+            pBufHdr->nFlags = pBufHdr->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
 
-            total_pcm_bytes += bytes_read;
+            total_pcm_bytes = (unsigned)(total_pcm_bytes + bytes_read);
         }
 
-    return bytes_read;;
+    return (int)bytes_read;;
 }
 
 
diff --git a/mm-audio/aenc-qcelp13/Android.mk b/mm-audio/aenc-qcelp13/Android.mk
index c919f19..2400c47 100644
--- a/mm-audio/aenc-qcelp13/Android.mk
+++ b/mm-audio/aenc-qcelp13/Android.mk
@@ -1,5 +1,4 @@
-ifeq ($(TARGET_ARCH),arm)
-
+ifneq ($(filter arm aarch64 arm64, $(TARGET_ARCH)),)
 
 AENC_QCELP13_PATH:= $(call my-dir)
 
@@ -27,5 +26,8 @@
 ifeq ($(call is-board-platform,msm8916),true)
 include $(AENC_QCELP13_PATH)/qdsp6/Android.mk
 endif
+ifeq ($(call is-board-platform,msm8994),true)
+include $(AENC_QCELP13_PATH)/qdsp6/Android.mk
+endif
 
 endif
diff --git a/mm-audio/aenc-qcelp13/qdsp6/Android.mk b/mm-audio/aenc-qcelp13/qdsp6/Android.mk
index 5aaa3bf..1c9ffe1 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/Android.mk
+++ b/mm-audio/aenc-qcelp13/qdsp6/Android.mk
@@ -13,6 +13,7 @@
 libOmxQcelp13Enc-def += -D_ENABLE_QC_MSG_LOG_
 libOmxQcelp13Enc-def += -DVERBOSE
 libOmxQcelp13Enc-def += -D_DEBUG
+libOmxQcelp13Enc-def += -Wconversion
 ifeq ($(strip $(TARGET_USES_QCOM_MM_AUDIO)),true)
 libOmxQcelp13Enc-def += -DAUDIOV2
 endif
diff --git a/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h b/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h
index c547809..22cc9ed 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h
+++ b/mm-audio/aenc-qcelp13/qdsp6/inc/omx_qcelp13_aenc.h
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -81,10 +81,10 @@
 
 
 #define PrintFrameHdr(i,bufHdr) \
-                           DEBUG_PRINT("i=%d OMX bufHdr[%x]buf[%x]size[%d]TS[%lld]nFlags[0x%x]\n",\
+                           DEBUG_PRINT("i=%d OMX bufHdr[%p]buf[%p]size[%d]TS[%lld]nFlags[0x%x]\n",\
                            i,\
-                           (unsigned) bufHdr,                                     \
-                           (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
+                           bufHdr,                                     \
+                           ((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer,   \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFilledLen,\
                            ((OMX_BUFFERHEADERTYPE *)bufHdr)->nTimeStamp, \
                            (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFlags)
@@ -245,7 +245,7 @@
                                 void *                  eglImage);
 
     bool post_command(unsigned int p1, unsigned int p2,
-        unsigned int id);
+        unsigned char id);
 
     // Deferred callback identifiers
     enum
@@ -304,9 +304,9 @@
 
     struct omx_event
     {
-        unsigned param1;
-        unsigned param2;
-        unsigned id;
+        unsigned long param1;
+        unsigned long param2;
+        unsigned char id;
     };
 
     struct omx_cmd_queue
@@ -318,16 +318,16 @@
 
         omx_cmd_queue();
         ~omx_cmd_queue();
-        bool insert_entry(unsigned p1, unsigned p2, unsigned id);
-        bool pop_entry(unsigned *p1,unsigned *p2, unsigned *id);
-        bool get_msg_id(unsigned *id);
+        bool insert_entry(unsigned long p1, unsigned long p2, unsigned char id);
+        bool pop_entry(unsigned long *p1,unsigned long *p2, unsigned char *id);
+        bool get_msg_id(unsigned char *id);
         bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned id);
     };
 
     typedef struct TIMESTAMP
     {
-        unsigned long LowPart;
-        unsigned long HighPart;
+        unsigned int LowPart;
+        unsigned int HighPart;
     }__attribute__((packed)) TIMESTAMP;
 
     typedef struct metadata_input
@@ -351,7 +351,7 @@
     {
         OMX_U32 tot_in_buf_len;
         OMX_U32 tot_out_buf_len;
-        OMX_U32 tot_pb_time;
+        OMX_TICKS tot_pb_time;
         OMX_U32 fbd_cnt;
         OMX_U32 ftb_cnt;
         OMX_U32 etb_cnt;
@@ -376,7 +376,7 @@
     bool                           is_in_th_sleep;
     bool                           is_out_th_sleep;
     unsigned int                   m_flags;      //encapsulate the waiting states.
-    unsigned int                   nTimestamp;
+    OMX_TICKS                      nTimestamp;
     unsigned int                   pcm_input; //tunnel or non-tunnel
     unsigned int                   m_inp_act_buf_count;    // Num of Input Buffers
     unsigned int                   m_out_act_buf_count;    // Numb of Output Buffers
@@ -508,11 +508,11 @@
 
     bool search_output_bufhdr(OMX_BUFFERHEADERTYPE *buffer);
 
-    bool post_input(unsigned int p1, unsigned int p2,
-                    unsigned int id);
+    bool post_input(unsigned long p1, unsigned long p2,
+                    unsigned char id);
 
-    bool post_output(unsigned int p1, unsigned int p2,
-                     unsigned int id);
+    bool post_output(unsigned long p1, unsigned long p2,
+                     unsigned char id);
 
     void process_events(omx_qcelp13_aenc *client_data);
 
diff --git a/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp b/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp
index f080e1f..b63f5a2 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp
+++ b/mm-audio/aenc-qcelp13/qdsp6/src/omx_qcelp13_aenc.cpp
@@ -1,5 +1,5 @@
 /*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -57,9 +57,9 @@
 }
 
 // omx cmd queue insert
-bool omx_qcelp13_aenc::omx_cmd_queue::insert_entry(unsigned p1,
-                                                unsigned p2,
-                                                unsigned id)
+bool omx_qcelp13_aenc::omx_cmd_queue::insert_entry(unsigned long p1,
+                                                unsigned long p2,
+                                                unsigned char id)
 {
     bool ret = true;
     if (m_size < OMX_CORE_CONTROL_CMDQ_SIZE)
@@ -81,8 +81,8 @@
     return ret;
 }
 
-bool omx_qcelp13_aenc::omx_cmd_queue::pop_entry(unsigned *p1,
-                                             unsigned *p2, unsigned *id)
+bool omx_qcelp13_aenc::omx_cmd_queue::pop_entry(unsigned long *p1,
+                                        unsigned long *p2, unsigned char *id)
 {
     bool ret = true;
     if (m_size > 0)
@@ -111,7 +111,7 @@
 {
     return(new omx_qcelp13_aenc);
 }
-bool omx_qcelp13_aenc::omx_cmd_queue::get_msg_id(unsigned *id)
+bool omx_qcelp13_aenc::omx_cmd_queue::get_msg_id(unsigned char *id)
 {
    if(m_size > 0)
    {
@@ -256,19 +256,24 @@
         m_tmp_out_meta_buf(NULL),
         m_flush_cnt(255),
         m_comp_deinit(0),
+        m_volume(25),
         m_app_data(NULL),
+        nNumInputBuf(0),
+        nNumOutputBuf(0),
         m_drv_fd(-1),
         bFlushinprogress(0),
         is_in_th_sleep(false),
         is_out_th_sleep(false),
         m_flags(0),
         nTimestamp(0),
+        pcm_input(0),
         m_inp_act_buf_count (OMX_CORE_NUM_INPUT_BUFFERS),
         m_out_act_buf_count (OMX_CORE_NUM_OUTPUT_BUFFERS),
         m_inp_current_buf_count(0),
         m_out_current_buf_count(0),
-        output_buffer_size(OMX_QCELP13_OUTPUT_BUFFER_SIZE),
+        output_buffer_size((OMX_U32)OMX_QCELP13_OUTPUT_BUFFER_SIZE),
         input_buffer_size(OMX_CORE_INPUT_BUFFER_SIZE),
+        m_session_id(0),
         m_inp_bEnabled(OMX_TRUE),
         m_out_bEnabled(OMX_TRUE),
         m_inp_bPopulated(OMX_FALSE),
@@ -278,12 +283,7 @@
         m_ipc_to_in_th(NULL),
         m_ipc_to_out_th(NULL),
         m_ipc_to_cmd_th(NULL),
-        m_volume(25),
-        pcm_input(0),
-        nNumOutputBuf(0),
-        m_session_id(0),
-        m_ipc_to_event_th(NULL),
-        nNumInputBuf(0)
+        m_ipc_to_event_th(NULL)
 {
     int cond_ret = 0;
     component_Role.nSize = 0;
@@ -502,13 +502,13 @@
         m_qcelp13_pb_stats.fbd_cnt++;
         pthread_mutex_lock(&out_buf_count_lock);
         nNumOutputBuf--;
-        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%lu fbd_cnt=%lu\n",\
+        DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%u fbd_cnt=%u\n",\
                     nNumOutputBuf,
                     m_qcelp13_pb_stats.tot_out_buf_len,
                     m_qcelp13_pb_stats.fbd_cnt);
         m_qcelp13_pb_stats.tot_out_buf_len += bufHdr->nFilledLen;
-        m_qcelp13_pb_stats.tot_pb_time     = bufHdr->nTimeStamp;
-        DEBUG_PRINT("FBD:in_buf_len=%lu out_buf_len=%lu\n",
+        m_qcelp13_pb_stats.tot_pb_time  = bufHdr->nTimeStamp;
+        DEBUG_PRINT("FBD:in_buf_len=%u out_buf_len=%u\n",
                     m_qcelp13_pb_stats.tot_in_buf_len,
                     m_qcelp13_pb_stats.tot_out_buf_len);
 
@@ -542,9 +542,9 @@
 =============================================================================*/
 void omx_qcelp13_aenc::process_out_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;                 // qsize
     unsigned      tot_qsize = 0;
     omx_qcelp13_aenc  *pThis    = (omx_qcelp13_aenc *) client_data;
@@ -746,9 +746,9 @@
 =============================================================================*/
 void omx_qcelp13_aenc::process_command_msg(void *client_data, unsigned char id)
 {
-    unsigned     p1;                             // Parameter - 1
-    unsigned     p2;                             // Parameter - 2
-    unsigned     ident;
+    unsigned long p1 = 0;                             // Parameter - 1
+    unsigned long p2 = 0;                             // Parameter - 2
+    unsigned char ident = 0;
     unsigned     qsize  = 0;
     omx_qcelp13_aenc *pThis = (omx_qcelp13_aenc*)client_data;
     pthread_mutex_lock(&pThis->m_commandlock);
@@ -820,15 +820,15 @@
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventError,
-                                         p2,
-                                         NULL,
-                                         NULL );
+                                         (OMX_U32)p2,
+                                         0,
+                                         0 );
             } else
             {
                 pThis->m_cb.EventHandler(&pThis->m_cmp,
                                          pThis->m_app_data,
                                          OMX_EventCmdComplete,
-                                         p1, p2, NULL );
+                                         (OMX_U32)p1, (OMX_U32)p2, NULL );
             }
         } else
         {
@@ -876,9 +876,9 @@
 =============================================================================*/
 void omx_qcelp13_aenc::process_in_port_msg(void *client_data, unsigned char id)
 {
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize     = 0;
     unsigned      tot_qsize = 0;
     omx_qcelp13_aenc  *pThis    = (omx_qcelp13_aenc *) client_data;
@@ -1056,7 +1056,7 @@
     randomly assign the value right now. Query will result in
     incorrect param */
     memset(&m_qcelp13_param, 0, sizeof(m_qcelp13_param));
-    m_qcelp13_param.nSize = sizeof(m_qcelp13_param);
+    m_qcelp13_param.nSize = (OMX_U32)sizeof(m_qcelp13_param);
     m_qcelp13_param.nChannels = OMX_QCELP13_DEFAULT_CH_CFG;
     //Current DSP does not have config
     m_qcelp13_param.eCDMARate = OMX_AUDIO_CDMARateFull;
@@ -1065,7 +1065,7 @@
     m_volume = OMX_QCELP13_DEFAULT_VOL;             /* Close to unity gain */
     memset(&m_qcelp13_pb_stats,0,sizeof(QCELP13_PB_STATS));
     memset(&m_pcm_param, 0, sizeof(m_pcm_param));
-    m_pcm_param.nSize = sizeof(m_pcm_param);
+    m_pcm_param.nSize = (OMX_U32)sizeof(m_pcm_param);
     m_pcm_param.nChannels = OMX_QCELP13_DEFAULT_CH_CFG;
     m_pcm_param.nSamplingRate = OMX_QCELP13_DEFAULT_SF;
     nTimestamp = 0;
@@ -1096,20 +1096,20 @@
     if (!strcmp(role,"OMX.qcom.audio.encoder.qcelp13"))
     {
         pcm_input = 1;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole, (const char*)role,
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else if (!strcmp(role,"OMX.qcom.audio.encoder.tunneled.qcelp13"))
     {
         pcm_input = 0;
-        component_Role.nSize = sizeof(role);
+        component_Role.nSize = (OMX_U32)sizeof(role);
         strlcpy((char *)component_Role.cRole, (const char*)role,
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
     } else
     {
-        component_Role.nSize = sizeof("\0");
+        component_Role.nSize = (OMX_U32)sizeof("\0");
         strlcpy((char *)component_Role.cRole, (const char*)"\0",
 		sizeof(component_Role.cRole));
         DEBUG_PRINT("\ncomponent_init: Component %s LOADED is invalid\n", role);
@@ -1255,7 +1255,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1269,7 +1269,7 @@
     }
     post_command((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
     DEBUG_PRINT("Send Command : returns with OMX_ErrorNone \n");
-    DEBUG_PRINT("send_command : recieved state before semwait= %lu\n",param1);
+    DEBUG_PRINT("send_command : recieved state before semwait= %u\n",param1);
     sem_wait (&sem_States);
     DEBUG_PRINT("send_command : recieved state after semwait\n");
     return OMX_ErrorNone;
@@ -1299,7 +1299,7 @@
 
     if(hComp == NULL)
     {
-        cmdData = NULL;
+        cmdData = cmdData;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -1464,7 +1464,7 @@
                     }
                     pcm_cfg.channel_count = m_pcm_param.nChannels;
                     pcm_cfg.sample_rate  =  m_pcm_param.nSamplingRate;
-                    DEBUG_PRINT("pcm config %lu %lu\n",m_pcm_param.nChannels,
+                    DEBUG_PRINT("pcm config %u %u\n",m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
 
                     if (ioctl(m_drv_fd, AUDIO_SET_CONFIG, &pcm_cfg) == -1)
@@ -1721,7 +1721,7 @@
     } else if (OMX_CommandFlush == cmd)
     {
         DEBUG_DETAIL("*************************\n");
-        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%lu\n",param1);
+        DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%u\n",param1);
         DEBUG_DETAIL("*************************\n");
         bFlag = 0;
         if ( param1 == OMX_CORE_INPUT_PORT_INDEX ||
@@ -1760,7 +1760,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable in "\
-                                " param1=%lu m_state=%d \n",param1, m_state);
+                                " param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 DEBUG_PRINT("send_command_proxy:OMX_CommandPortDisable:\
@@ -1792,7 +1792,7 @@
                 if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
                 {
                     DEBUG_PRINT("SCP: execute_omx_flush in Disable out "\
-                                "param1=%lu m_state=%d \n",param1, m_state);
+                                "param1=%u m_state=%d \n",param1, m_state);
                     execute_omx_flush(param1);
                 }
                 BITMASK_SET(&m_flags, OMX_COMPONENT_OUTPUT_DISABLE_PENDING);
@@ -1909,7 +1909,7 @@
 {
     bool bRet = true;
 
-    DEBUG_PRINT("Execute_omx_flush Port[%lu]", param1);
+    DEBUG_PRINT("Execute_omx_flush Port[%u]", param1);
     struct timespec abs_timeout;
     abs_timeout.tv_sec = 1;
     abs_timeout.tv_nsec = 0;
@@ -1959,7 +1959,7 @@
         DEBUG_DETAIL("WAITING FOR FLUSH ACK's param1=%d",param1);
         wait_for_event();
 
-        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%lu cmd_cmpl=%d",\
+        DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%u cmd_cmpl=%d",\
                     param1,cmd_cmpl);
 
         // If not going to idle state, Send FLUSH complete message
@@ -2073,7 +2073,7 @@
         DEBUG_DETAIL("RECIEVED FLUSH ACK FOR O/P PORT param1=%d",param1);
     } else
     {
-        DEBUG_PRINT("Invalid Port ID[%lu]",param1);
+        DEBUG_PRINT("Invalid Port ID[%u]",param1);
     }
     return bRet;
 }
@@ -2101,9 +2101,9 @@
 bool omx_qcelp13_aenc::execute_input_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2181,9 +2181,9 @@
 bool omx_qcelp13_aenc::execute_output_omx_flush()
 {
     OMX_BUFFERHEADERTYPE *omx_buf;
-    unsigned      p1;                            // Parameter - 1
-    unsigned      p2;                            // Parameter - 2
-    unsigned      ident;
+    unsigned long p1 = 0;                            // Parameter - 1
+    unsigned long p2 = 0;                            // Parameter - 2
+    unsigned char ident = 0;
     unsigned      qsize=0;                       // qsize
     unsigned      tot_qsize=0;                   // qsize
 
@@ -2264,9 +2264,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_qcelp13_aenc::post_input(unsigned int p1,
-                               unsigned int p2,
-                               unsigned int id)
+bool omx_qcelp13_aenc::post_input(unsigned long p1,
+                               unsigned long p2,
+                               unsigned char id)
 {
     bool bRet = false;
     pthread_mutex_lock(&m_lock);
@@ -2327,7 +2327,7 @@
 =============================================================================*/
 bool omx_qcelp13_aenc::post_command(unsigned int p1,
                                  unsigned int p2,
-                                 unsigned int id)
+                                 unsigned char id)
 {
     bool bRet  = false;
 
@@ -2374,9 +2374,9 @@
 SIDE EFFECTS:
   None
 =============================================================================*/
-bool omx_qcelp13_aenc::post_output(unsigned int p1,
-                                unsigned int p2,
-                                unsigned int id)
+bool omx_qcelp13_aenc::post_output(unsigned long p1,
+                                unsigned long p2,
+                                unsigned char id)
 {
     bool bRet = false;
 
@@ -2440,7 +2440,7 @@
         return OMX_ErrorBadParameter;
     }
 
-    switch (paramIndex)
+    switch ((int)paramIndex)
     {
         case OMX_IndexParamPortDefinition:
             {
@@ -2448,11 +2448,11 @@
                 portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
 
                 DEBUG_PRINT("OMX_IndexParamPortDefinition " \
-                            "portDefn->nPortIndex = %lu\n",
+                            "portDefn->nPortIndex = %u\n",
 				portDefn->nPortIndex);
 
                 portDefn->nVersion.nVersion = OMX_SPEC_VERSION;
-                portDefn->nSize = sizeof(portDefn);
+                portDefn->nSize = (OMX_U32)sizeof(portDefn);
                 portDefn->eDomain    = OMX_PortDomainAudio;
 
                 if (0 == portDefn->nPortIndex)
@@ -2494,7 +2494,7 @@
                 DEBUG_PRINT("OMX_IndexParamAudioInit\n");
 
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 2;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2506,7 +2506,7 @@
                 (OMX_AUDIO_PARAM_PORTFORMATTYPE *) paramData;
                 DEBUG_PRINT("OMX_IndexParamAudioPortFormat\n");
                 portFormatType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portFormatType->nSize = sizeof(portFormatType);
+                portFormatType->nSize = (OMX_U32)sizeof(portFormatType);
 
                 if (OMX_CORE_INPUT_PORT_INDEX == portFormatType->nPortIndex)
                 {
@@ -2516,7 +2516,7 @@
 				portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("get_parameter: OMX_IndexParamAudioFormat: "\
-                                "%lu\n", portFormatType->nIndex);
+                                "%u\n", portFormatType->nIndex);
 
             portFormatType->eEncoding = OMX_AUDIO_CodingQCELP13;
                 } else
@@ -2551,7 +2551,7 @@
     {
        QOMX_AUDIO_STREAM_INFO_DATA *streaminfoparam =
                (QOMX_AUDIO_STREAM_INFO_DATA *) paramData;
-       streaminfoparam->sessionId = m_session_id;
+       streaminfoparam->sessionId = (OMX_U8)m_session_id;
        break;
     }
 
@@ -2564,9 +2564,9 @@
                 {
                     memcpy(pcmparam,&m_pcm_param,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
-                    DEBUG_PRINT("get_parameter: Sampling rate %lu",\
+                    DEBUG_PRINT("get_parameter: Sampling rate %u",\
                                  pcmparam->nSamplingRate);
-                    DEBUG_PRINT("get_parameter: Number of channels %lu",\
+                    DEBUG_PRINT("get_parameter: Number of channels %u",\
                                  pcmparam->nChannels);
                 } else
                 {
@@ -2591,7 +2591,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamVideoInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2601,7 +2601,7 @@
                 OMX_PRIORITYMGMTTYPE *priorityMgmtType =
                 (OMX_PRIORITYMGMTTYPE*)paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamPriorityMgmt\n");
-                priorityMgmtType->nSize = sizeof(priorityMgmtType);
+                priorityMgmtType->nSize = (OMX_U32)sizeof(priorityMgmtType);
                 priorityMgmtType->nVersion.nVersion = OMX_SPEC_VERSION;
                 priorityMgmtType->nGroupID = m_priority_mgm.nGroupID;
                 priorityMgmtType->nGroupPriority =
@@ -2614,7 +2614,7 @@
                 (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamImageInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2629,7 +2629,7 @@
                 DEBUG_PRINT("get_parameter: \
 				OMX_IndexParamCompBufferSupplier\n");
 
-                bufferSupplierType->nSize = sizeof(bufferSupplierType);
+                bufferSupplierType->nSize = (OMX_U32)sizeof(bufferSupplierType);
                 bufferSupplierType->nVersion.nVersion = OMX_SPEC_VERSION;
                 if (OMX_CORE_INPUT_PORT_INDEX   ==
 				bufferSupplierType->nPortIndex)
@@ -2658,7 +2658,7 @@
                     (OMX_PORT_PARAM_TYPE *) paramData;
                 DEBUG_PRINT("get_parameter: OMX_IndexParamOtherInit\n");
                 portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
-                portParamType->nSize = sizeof(portParamType);
+                portParamType->nSize = (OMX_U32)sizeof(portParamType);
                 portParamType->nPorts           = 0;
                 portParamType->nStartPortNumber = 0;
                 break;
@@ -2756,7 +2756,7 @@
                     return OMX_ErrorIncorrectStateOperation;
                 }
                 DEBUG_PRINT("OMX_IndexParamPortDefinition portDefn->nPortIndex "
-                            "= %lu\n",portDefn->nPortIndex);
+                            "= %u\n",portDefn->nPortIndex);
                 if (OMX_CORE_INPUT_PORT_INDEX == portDefn->nPortIndex)
                 {
                     if ( portDefn->nBufferCountActual >
@@ -2800,10 +2800,10 @@
                 }
                 OMX_PRIORITYMGMTTYPE *priorityMgmtype
                 = (OMX_PRIORITYMGMTTYPE*) paramData;
-                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %lu\n",
+                DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %u\n",
                             priorityMgmtype->nGroupID);
 
-                DEBUG_PRINT("set_parameter: priorityMgmtype %lu\n",
+                DEBUG_PRINT("set_parameter: priorityMgmtype %u\n",
                             priorityMgmtype->nGroupPriority);
 
                 m_priority_mgm.nGroupID = priorityMgmtype->nGroupID;
@@ -2825,7 +2825,7 @@
 					 portFormatType->nPortIndex)
                 {
                     DEBUG_PRINT("set_parameter: OMX_IndexParamAudioFormat:"\
-                                " %lu\n", portFormatType->nIndex);
+                                " %u\n", portFormatType->nIndex);
                     portFormatType->eEncoding = OMX_AUDIO_CodingQCELP13;
                 } else
                 {
@@ -2873,7 +2873,7 @@
                 {
                     memcpy(&m_pcm_param,pcmparam,\
                         sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
-                    DEBUG_PRINT("set_pcm_parameter: %lu %lu",\
+                    DEBUG_PRINT("set_pcm_parameter: %u %u",\
                                  m_pcm_param.nChannels,
 				m_pcm_param.nSamplingRate);
                 } else
@@ -2951,7 +2951,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == volume->nPortIndex)
                 {
-                    volume->nSize = sizeof(volume);
+                    volume->nSize = (OMX_U32)sizeof(volume);
                     volume->nVersion.nVersion = OMX_SPEC_VERSION;
                     volume->bLinear = OMX_TRUE;
                     volume->sVolume.nValue = m_volume;
@@ -2971,7 +2971,7 @@
 
                 if (OMX_CORE_INPUT_PORT_INDEX == mute->nPortIndex)
                 {
-                    mute->nSize = sizeof(mute);
+                    mute->nSize = (OMX_U32)sizeof(mute);
                     mute->nVersion.nVersion = OMX_SPEC_VERSION;
                     mute->bMute = (BITMASK_PRESENT(&m_flags,
                                       OMX_COMPONENT_MUTED)?OMX_TRUE:OMX_FALSE);
@@ -3179,8 +3179,8 @@
 
     if((hComp == NULL) || (peerComponent == NULL) || (tunnelSetup == NULL))
     {
-        port = 0;
-        peerPort = 0;
+        port = port;
+        peerPort = peerPort;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3220,7 +3220,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         free(buf_ptr);
         return OMX_ErrorBadParameter;
@@ -3233,7 +3233,7 @@
 
         bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) + sizeof(META_IN)+
                                                sizeof(OMX_BUFFERHEADERTYPE));
-        bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+        bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
         bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
         bufHdr->nAllocLen         = nBufSize;
         bufHdr->pAppPrivate       = appData;
@@ -3242,7 +3242,7 @@
 
         m_inp_current_buf_count++;
         DEBUG_PRINT("AIB:bufHdr %p bufHdr->pBuffer %p m_inp_buf_cnt=%d \
-		bytes=%lu", bufHdr, bufHdr->pBuffer,m_inp_current_buf_count,
+		bytes=%u", bufHdr, bufHdr->pBuffer,m_inp_current_buf_count,
                     bytes);
 
     } else
@@ -3274,7 +3274,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3290,7 +3290,7 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)((buf_ptr) +
 					sizeof(OMX_BUFFERHEADERTYPE));
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             bufHdr->pAppPrivate       = appData;
@@ -3298,7 +3298,7 @@
             m_output_buf_hdrs.insert(bufHdr, NULL);
             m_out_current_buf_count++;
             DEBUG_PRINT("AOB::bufHdr %p bufHdr->pBuffer %p m_out_buf_cnt=%d "\
-                        "bytes=%lu",bufHdr, bufHdr->pBuffer,\
+                        "bytes=%u",bufHdr, bufHdr->pBuffer,\
                         m_out_current_buf_count, bytes);
         } else
         {
@@ -3512,7 +3512,7 @@
         }
     }
   }
-    DEBUG_PRINT("Use Buffer for port[%lu] eRet[%d]\n", port,eRet);
+    DEBUG_PRINT("Use Buffer for port[%u] eRet[%d]\n", port,eRet);
     return eRet;
 }
 /*=============================================================================
@@ -3555,7 +3555,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3577,8 +3577,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_input_buffer:bufHdr %p bufHdr->pBuffer %p \
-			bytes=%lu", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			bytes=%u", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             input_buffer_size         = nBufSize;
@@ -3640,7 +3640,7 @@
 
     if(hComp == NULL)
     {
-        port = 0;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -3666,8 +3666,8 @@
 
             bufHdr->pBuffer           = (OMX_U8 *)(buffer);
             DEBUG_PRINT("use_output_buffer:bufHdr %p bufHdr->pBuffer %p \
-			len=%lu\n", bufHdr, bufHdr->pBuffer,bytes);
-            bufHdr->nSize             = sizeof(OMX_BUFFERHEADERTYPE);
+			len=%u\n", bufHdr, bufHdr->pBuffer,bytes);
+            bufHdr->nSize             = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
             bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
             bufHdr->nAllocLen         = nBufSize;
             output_buffer_size        = nBufSize;
@@ -3767,7 +3767,7 @@
                (m_out_bEnabled == OMX_FALSE &&
 		port == OMX_CORE_OUTPUT_PORT_INDEX))
     {
-        DEBUG_PRINT("Free Buffer while port %lu disabled\n", port);
+        DEBUG_PRINT("Free Buffer while port %u disabled\n", port);
     } else if (m_state == OMX_StateExecuting || m_state == OMX_StatePause)
     {
         DEBUG_PRINT("Invalid state to free buffer,ports need to be disabled:\
@@ -3901,7 +3901,7 @@
 {
     OMX_ERRORTYPE eRet = OMX_ErrorNone;
 
-    DEBUG_PRINT("ETB:Buf:%p Len %lu TS %lld numInBuf=%d\n", \
+    DEBUG_PRINT("ETB:Buf:%p Len %u TS %lld numInBuf=%d\n", \
                 buffer, buffer->nFilledLen, buffer->nTimeStamp, (nNumInputBuf));
     if (m_state == OMX_StateInvalid)
     {
@@ -3939,11 +3939,11 @@
     {
         if (search_input_bufhdr(buffer) == true)
         {
-            post_input((unsigned)hComp,
-                       (unsigned) buffer,OMX_COMPONENT_GENERATE_ETB);
+            post_input((unsigned long)hComp,
+                       (unsigned long) buffer,OMX_COMPONENT_GENERATE_ETB);
         } else
         {
-            DEBUG_PRINT_ERROR("Bad header %x \n", (int)buffer);
+            DEBUG_PRINT_ERROR("Bad header %p \n", buffer);
             eRet = OMX_ErrorBadParameter;
         }
     }
@@ -3985,11 +3985,11 @@
         data = m_tmp_meta_buf;
 
         // copy the metadata info from the BufHdr and insert to payload
-        meta_in.offsetVal  = sizeof(META_IN);
+        meta_in.offsetVal  = (OMX_U16)sizeof(META_IN);
         meta_in.nTimeStamp.LowPart =
-           ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
+           (unsigned int)((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) & 0xFFFFFFFF);
         meta_in.nTimeStamp.HighPart =
-           (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
+           (unsigned int)(((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
         meta_in.nFlags &= ~OMX_BUFFERFLAG_EOS;
         if(buffer->nFlags & OMX_BUFFERFLAG_EOS)
         {
@@ -4016,7 +4016,7 @@
         /* Assume empty this buffer function has already checked
         validity of buffer */
         DEBUG_PRINT("Empty buffer %p to kernel driver\n", buffer);
-        post_input((unsigned) & hComp,(unsigned) buffer,
+        post_input((unsigned long) & hComp,(unsigned long) buffer,
                    OMX_COMPONENT_GENERATE_BUFFER_DONE);
     }
     return OMX_ErrorNone;
@@ -4029,7 +4029,7 @@
 {
     OMX_STATETYPE state;
     ENC_META_OUT *meta_out = NULL;
-    int nReadbytes = 0;
+    ssize_t nReadbytes = 0;
 
     pthread_mutex_lock(&m_state_lock);
     get_state(&m_cmp, &state);
@@ -4060,8 +4060,9 @@
           buffer->nTimeStamp = (((OMX_TICKS)meta_out->msw_ts << 32)+
 				meta_out->lsw_ts);
           buffer->nFlags |= meta_out->nflags;
-          buffer->nOffset =  meta_out->offset_to_frame + sizeof(unsigned char);
-          buffer->nFilledLen = nReadbytes - buffer->nOffset;
+          buffer->nOffset = (OMX_U32) (meta_out->offset_to_frame +
+                              sizeof(unsigned char));
+          buffer->nFilledLen = (OMX_U32)(nReadbytes - buffer->nOffset);
           nTimestamp = buffer->nTimeStamp;
           DEBUG_PRINT("nflags %d frame_size %d offset_to_frame %d \
 			timestamp %lld\n", meta_out->nflags,
@@ -4095,7 +4096,7 @@
           {
               DEBUG_PRINT("FTBP:Post the FBD to event thread currstate=%d\n",\
                             state);
-              post_output((unsigned) & hComp,(unsigned) buffer,
+              post_output((unsigned long) & hComp,(unsigned long) buffer,
                             OMX_COMPONENT_GENERATE_FRAME_DONE);
           }
           else
@@ -4160,8 +4161,8 @@
     m_qcelp13_pb_stats.ftb_cnt++;
     DEBUG_DETAIL("FTB:nNumOutputBuf is %d", nNumOutputBuf);
     pthread_mutex_unlock(&out_buf_count_lock);
-    post_output((unsigned)hComp,
-                (unsigned) buffer,OMX_COMPONENT_GENERATE_FTB);
+    post_output((unsigned long)hComp,
+                (unsigned long) buffer,OMX_COMPONENT_GENERATE_FTB);
     return eRet;
 }
 
@@ -4245,11 +4246,11 @@
 {
     DEBUG_PRINT("Component-deinit being processed\n");
     DEBUG_PRINT("********************************\n");
-    DEBUG_PRINT("STATS: in-buf-len[%lu]out-buf-len[%lu] tot-pb-time[%ld]",\
+    DEBUG_PRINT("STATS: in-buf-len[%u]out-buf-len[%u] tot-pb-time[%lld]",\
                 m_qcelp13_pb_stats.tot_in_buf_len,
                 m_qcelp13_pb_stats.tot_out_buf_len,
                 m_qcelp13_pb_stats.tot_pb_time);
-    DEBUG_PRINT("STATS: fbd-cnt[%lu]ftb-cnt[%lu]etb-cnt[%lu]ebd-cnt[%lu]",\
+    DEBUG_PRINT("STATS: fbd-cnt[%u]ftb-cnt[%u]etb-cnt[%u]ebd-cnt[%u]",\
                 m_qcelp13_pb_stats.fbd_cnt,m_qcelp13_pb_stats.ftb_cnt,
                 m_qcelp13_pb_stats.etb_cnt,
                 m_qcelp13_pb_stats.ebd_cnt);
@@ -4389,8 +4390,8 @@
 
     if((hComp == NULL) || (appData == NULL) || (eglImage == NULL))
     {
-        bufferHdr = NULL;
-        port = 0;
+        bufferHdr = bufferHdr;
+        port = port;
         DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
         return OMX_ErrorBadParameter;
     }
@@ -4425,8 +4426,8 @@
     }
     if (index == 0 && role)
     {
-        memcpy(role, cmp_role, sizeof(cmp_role));
-        *(((char *) role) + sizeof(cmp_role)) = '\0';
+        memcpy(role, cmp_role, strlen(cmp_role));
+        *(((char *) role) + strlen(cmp_role) + 1) = '\0';
     } else
     {
         eRet = OMX_ErrorNoMore;
diff --git a/mm-audio/aenc-qcelp13/qdsp6/test/omx_qcelp13_enc_test.c b/mm-audio/aenc-qcelp13/qdsp6/test/omx_qcelp13_enc_test.c
index 5c59349..432c07a 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/test/omx_qcelp13_enc_test.c
+++ b/mm-audio/aenc-qcelp13/qdsp6/test/omx_qcelp13_enc_test.c
@@ -1,6 +1,6 @@
 
 /*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -85,8 +85,8 @@
 uint32_t min_bitrate = 0;
 uint32_t max_bitrate = 0;
 uint32_t cdmarate = 0;
-uint32_t rectime = -1;
-uint32_t recpath = -1;
+uint32_t rectime = 0;
+uint32_t recpath = 0;
 uint32_t pcmplayback = 0;
 uint32_t tunnel      = 0;
 uint32_t format = 1;
@@ -217,14 +217,14 @@
          {'v','r','a','t'},0, 0, 0,{'d','a','t','a'},0
  };
 
-static unsigned totaldatalen = 0;
-static unsigned framecnt = 0;
+static int totaldatalen = 0;
+static int framecnt = 0;
 /************************************************************************/
 /*                GLOBAL INIT                    */
 /************************************************************************/
 
-int input_buf_cnt = 0;
-int output_buf_cnt = 0;
+unsigned int input_buf_cnt = 0;
+unsigned int output_buf_cnt = 0;
 int used_ip_buf_cnt = 0;
 volatile int event_is_done = 0;
 volatile int ebd_event_is_done = 0;
@@ -265,7 +265,7 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *qcelp13_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize);
+                                       unsigned int bufCntMin, unsigned int bufSize);
 
 
 static OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
@@ -325,7 +325,7 @@
 
 static void create_qcp_header(int Datasize, int Frames)
 {
-        append_header.s_riff = Datasize + QCP_HEADER_SIZE - 8;
+        append_header.s_riff = (unsigned)(Datasize + (int)QCP_HEADER_SIZE - 8);
         /* exclude riff id and size field */
         append_header.data1 = 0x5E7F6D41;
         append_header.data2 = 0xB115;
@@ -349,8 +349,8 @@
         append_header.vr_bytes_per_pkt[3] = 0x0103;
         append_header.s_vrat = 0x00000008;
         append_header.v_rate = 0x00000001;
-        append_header.size_in_pkts = Frames;
-        append_header.s_data = Datasize;
+        append_header.size_in_pkts = (unsigned)Frames;
+        append_header.s_data = (unsigned)Datasize;
         return;
 }
 
@@ -369,7 +369,7 @@
 
     switch(eEvent) {
         case OMX_EventCmdComplete:
-        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%lu data2=%lu\n",(OMX_EVENTTYPE)eEvent,
+        DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%u data2=%u\n",(OMX_EVENTTYPE)eEvent,
                                                                                nData1,nData2);
             event_complete();
         break;
@@ -396,8 +396,8 @@
                               OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
 {
     size_t bytes_writen = 0;
-    int total_bytes_writen = 0;
-    unsigned int len = 0;
+    size_t total_bytes_writen = 0;
+    size_t len = 0;
     struct enc_meta_out *meta = NULL;
     OMX_U8 *src = pBuffer->pBuffer;
     unsigned int num_of_frames = 1;
@@ -444,8 +444,8 @@
             num_of_frames--;
             total_bytes_writen += len;
         }
-        DEBUG_PRINT(" FillBufferDone size writen to file  %d count %d\n",total_bytes_writen, framecnt);
-        totaldatalen += total_bytes_writen ;
+        DEBUG_PRINT(" FillBufferDone size writen to file  %zu count %d\n",total_bytes_writen, framecnt);
+        totaldatalen = totaldatalen + (int)total_bytes_writen;
     framecnt++;
 
         DEBUG_PRINT(" FBD calling FTB\n");
@@ -498,7 +498,7 @@
     }
 
     if((readBytes = Read_Buffer(pBuffer)) > 0) {
-        pBuffer->nFilledLen = readBytes;
+        pBuffer->nFilledLen = (OMX_U32)readBytes;
         used_ip_buf_cnt++;
         OMX_EmptyThisBuffer(hComponent,pBuffer);
     }
@@ -535,7 +535,7 @@
 
 int main(int argc, char **argv)
 {
-     int bufCnt=0;
+     unsigned int bufCnt=0;
      OMX_ERRORTYPE result;
 
     struct sigaction sa;
@@ -557,12 +557,12 @@
     if (argc >= 9) {
         in_filename = argv[1];
           out_filename = argv[2];
-    tunnel =  atoi(argv[3]);
-        min_bitrate  = atoi(argv[4]);
-        max_bitrate  = atoi(argv[5]);
-        cdmarate     = atoi(argv[6]);
-        recpath      = atoi(argv[7]); // No configuration support yet..
-        rectime      = atoi(argv[8]);
+    tunnel =  (uint32_t)atoi(argv[3]);
+        min_bitrate  = (uint32_t)atoi(argv[4]);
+        max_bitrate  = (uint32_t)atoi(argv[5]);
+        cdmarate     = (uint32_t)atoi(argv[6]);
+        recpath      = (uint32_t)atoi(argv[7]); // No configuration support yet..
+        rectime      = (uint32_t)atoi(argv[8]);
 
     } else {
           DEBUG_PRINT(" invalid format: \n");
@@ -735,7 +735,7 @@
     /* Query for audio decoders*/
     DEBUG_PRINT("Qcelp13_test: Before entering OMX_GetComponentOfRole");
     OMX_GetComponentsOfRole(role, &total, 0);
-    DEBUG_PRINT ("\nTotal components of role=%s :%lu", role, total);
+    DEBUG_PRINT ("\nTotal components of role=%s :%u", role, total);
 
 
     omxresult = OMX_GetHandle((OMX_HANDLETYPE*)(&qcelp13_enc_handle),
@@ -760,8 +760,8 @@
     }
     else
     {
-        DEBUG_PRINT("\nportParam.nPorts:%lu\n", portParam.nPorts);
-    DEBUG_PRINT("\nportParam.nStartPortNumber:%lu\n",
+        DEBUG_PRINT("\nportParam.nPorts:%u\n", portParam.nPorts);
+    DEBUG_PRINT("\nportParam.nStartPortNumber:%u\n",
                                              portParam.nStartPortNumber);
     }
 
@@ -775,12 +775,16 @@
 
 int Play_Encoder()
 {
-    int i;
+    unsigned int i;
     int Size=0;
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE ret;
     OMX_INDEXTYPE index;
+#ifdef __LP64__
+    DEBUG_PRINT("sizeof[%ld]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#else
     DEBUG_PRINT("sizeof[%d]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#endif
 
     /* open the i/p and o/p files based on the video file format passed */
     if(open_audio_file()) {
@@ -795,8 +799,8 @@
     inputportFmt.nPortIndex = portParam.nStartPortNumber;
 
     OMX_GetParameter(qcelp13_enc_handle,OMX_IndexParamPortDefinition,&inputportFmt);
-    DEBUG_PRINT ("\nEnc Input Buffer Count %lu\n", inputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Input Buffer Size %lu\n", inputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc Input Buffer Count %u\n", inputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Input Buffer Size %u\n", inputportFmt.nBufferSize);
 
     if(OMX_DirInput != inputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Input Port\n");
@@ -815,8 +819,8 @@
     outputportFmt.nPortIndex = portParam.nStartPortNumber + 1;
 
     OMX_GetParameter(qcelp13_enc_handle,OMX_IndexParamPortDefinition,&outputportFmt);
-    DEBUG_PRINT ("\nEnc: Output Buffer Count %lu\n", outputportFmt.nBufferCountMin);
-    DEBUG_PRINT ("\nEnc: Output Buffer Size %lu\n", outputportFmt.nBufferSize);
+    DEBUG_PRINT ("\nEnc: Output Buffer Count %u\n", outputportFmt.nBufferCountMin);
+    DEBUG_PRINT ("\nEnc: Output Buffer Size %u\n", outputportFmt.nBufferSize);
 
     if(OMX_DirOutput != outputportFmt.eDir) {
         DEBUG_PRINT ("\nEnc: Expect Output Port\n");
@@ -906,7 +910,7 @@
     for(i=0; i < output_buf_cnt; i++) {
         DEBUG_PRINT ("\nOMX_FillThisBuffer on output buf no.%d\n",i);
         pOutputBufHdrs[i]->nOutputPortIndex = 1;
-        pOutputBufHdrs[i]->nFlags &= ~OMX_BUFFERFLAG_EOS;
+        pOutputBufHdrs[i]->nFlags = pOutputBufHdrs[i]->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
         ret = OMX_FillThisBuffer(qcelp13_enc_handle, pOutputBufHdrs[i]);
         if (OMX_ErrorNone != ret) {
             DEBUG_PRINT("OMX_FillThisBuffer failed with result %d\n", ret);
@@ -928,7 +932,7 @@
           bInputEosReached = true;
           pInputBufHdrs[i]->nFlags= OMX_BUFFERFLAG_EOS;
         }
-        pInputBufHdrs[i]->nFilledLen = Size;
+        pInputBufHdrs[i]->nFilledLen = (OMX_U32)Size;
         pInputBufHdrs[i]->nInputPortIndex = 0;
         used_ip_buf_cnt++;
         ret = OMX_EmptyThisBuffer(qcelp13_enc_handle, pInputBufHdrs[i]);
@@ -966,11 +970,11 @@
 static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *avc_enc_handle,
                                        OMX_BUFFERHEADERTYPE  ***pBufHdrs,
                                        OMX_U32 nPortIndex,
-                                       long bufCntMin, long bufSize)
+                                       unsigned int bufCntMin, unsigned int bufSize)
 {
     DEBUG_PRINT("Inside %s \n", __FUNCTION__);
     OMX_ERRORTYPE error=OMX_ErrorNone;
-    long bufCnt=0;
+    unsigned int bufCnt=0;
 
     /* To remove warning for unused variable to keep prototype same */
     (void)avc_enc_handle;
@@ -979,7 +983,7 @@
                    malloc(sizeof(OMX_BUFFERHEADERTYPE*)*bufCntMin);
 
     for(bufCnt=0; bufCnt < bufCntMin; ++bufCnt) {
-        DEBUG_PRINT("\n OMX_AllocateBuffer No %ld \n", bufCnt);
+        DEBUG_PRINT("\n OMX_AllocateBuffer No %d \n", bufCnt);
         error = OMX_AllocateBuffer(qcelp13_enc_handle, &((*pBufHdrs)[bufCnt]),
                                    nPortIndex, NULL, bufSize);
     }
@@ -993,7 +997,7 @@
 static int Read_Buffer (OMX_BUFFERHEADERTYPE  *pBufHdr )
 {
 
-    int bytes_read=0;
+    size_t bytes_read=0;
 
 
     pBufHdr->nFilledLen = 0;
@@ -1001,11 +1005,11 @@
 
      bytes_read = fread(pBufHdr->pBuffer, 1, pBufHdr->nAllocLen , inputBufferFile);
 
-      pBufHdr->nFilledLen = bytes_read;
+      pBufHdr->nFilledLen = (OMX_U32)bytes_read;
       // Time stamp logic
     ((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp = \
 
-    (unsigned long) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
+    (OMX_TICKS) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
 
        DEBUG_PRINT ("\n--time stamp -- %ld\n",  (unsigned long)((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp);
         if(bytes_read == 0)
@@ -1015,12 +1019,12 @@
         }
         else
         {
-            pBufHdr->nFlags &= ~OMX_BUFFERFLAG_EOS;
+            pBufHdr->nFlags = pBufHdr->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
 
-            total_pcm_bytes += bytes_read;
+            total_pcm_bytes = (unsigned)(total_pcm_bytes + bytes_read);
         }
 
-    return bytes_read;;
+    return (int)bytes_read;;
 }