Merge "Switch msmnile to new Audio HAL" into qt-dev
diff --git a/hal/audio_extn/audiozoom.c b/hal/audio_extn/audiozoom.c
index 86d53b4..73e4862 100644
--- a/hal/audio_extn/audiozoom.c
+++ b/hal/audio_extn/audiozoom.c
@@ -31,7 +31,6 @@
 #include <resolv.h>
 
 #define AUDIOZOOM_PRESET_FILE "/vendor/etc/audiozoom.xml"
-#define MIN_BUFSIZE 8
 
 typedef struct qdsp_audiozoom_cfg {
     uint32_t             topo_id;
@@ -190,8 +189,9 @@
 {
     struct audio_device *adev = in->dev;
     struct str_parms *parms = str_parms_create();
-    uint8_t value[MIN_BUFSIZE] = {0};
-    char data[MIN_BUFSIZE * 2] = {0};
+    /* The encoding process in b64_ntop represents 24-bit groups of input bits
+       as output strings of 4 encoded characters. */
+    char data[((sizeof(zoom) + 2) / 3) * 4 + 1] = {0};
     int32_t ret;
 
     if (zoom > 1.0 || zoom < 0)
@@ -208,10 +208,7 @@
     str_parms_add_int(parms, "cal_instanceid", qdsp_audiozoom.instance_id);
     str_parms_add_int(parms, "cal_paramid", qdsp_audiozoom.zoom_param_id);
 
-    zoom *= 255;
-    value[0] = (uint8_t) zoom; /* Valid value is 0 to 255 */
-
-    ret = b64_ntop(value, sizeof(value), data, sizeof(data));
+    ret = b64_ntop((uint8_t*)&zoom, sizeof(zoom), data, sizeof(data));
     if (ret > 0) {
         str_parms_add_str(parms, "cal_data", data);
 
diff --git a/voice_processing/voice_processing.c b/voice_processing/voice_processing.c
index 8c6e7fc..c363ba4 100644
--- a/voice_processing/voice_processing.c
+++ b/voice_processing/voice_processing.c
@@ -20,7 +20,7 @@
 #include <dlfcn.h>
 #include <unistd.h>
 
-#include <cutils/log.h>
+#include <log/log.h>
 #include <cutils/list.h>
 #include <hardware/audio_effect.h>
 #include <audio_effects/effect_aec.h>
@@ -401,7 +401,7 @@
 
     list_for_each(node, &session_list) {
         session = node_to_item(node, struct session_s, node);
-        if (session->io == ioId) {
+        if (session->id == sessionId) {
             if (session->created_msk & (1 << id)) {
                 ALOGV("get_session() effect %d already created", id);
                 return NULL;