hal_play_test: Fix for glitch in multichannel pcm playback

Amount of input data fed to MS12 in this usecase is very less,
which ends up in less amount of data at mixer_node. Hence increased
the amount of input data fed for pcm type.

Correcting parsing logic for play_list usecase.

Change-Id: I4e0e70ab7edfc8931df26a5e520a5dd35bfac5f3
diff --git a/qahw_api/test/qap_wrapper_extn.c b/qahw_api/test/qap_wrapper_extn.c
index 349aa16..7d3d4da 100644
--- a/qahw_api/test/qap_wrapper_extn.c
+++ b/qahw_api/test/qap_wrapper_extn.c
@@ -56,6 +56,7 @@
 #define TIMESTAMP_ARRAY_SIZE 2048
 #define DOLBY 1
 #define DTS   2
+#define FRAME_SIZE_FOR_2CH_PCM 6144 /* For 48k samplerate, 2 ch, 2 bytes */
 
 qap_lib_handle_t ms12_lib_handle = NULL;
 qap_lib_handle_t m8_lib_handle = NULL;
@@ -296,7 +297,7 @@
     char *play_list = NULL;
     int len = 0;
 
-    tmp_str = strstr(kvp_string, "g=");
+    tmp_str = strstr(kvp_string, "g=/");
     if (tmp_str != NULL) {
         file_str = strstr(kvp_string, ".txt");
         len = file_str - tmp_str;
@@ -503,7 +504,7 @@
     }
 
     if (mem > 0)
-        kvps = malloc(mem * sizeof(char));
+        kvps = calloc(1, mem * sizeof(char));
     else {
         *status = -EINVAL;
         fprintf(stdout, "%s %d returning EINVAL\n", __func__, __LINE__);
@@ -1293,6 +1294,10 @@
                 int wav_header_len = get_wav_header_length(stream_info->file_stream);
                 fseek(fp_input, wav_header_len, SEEK_SET);
             }
+            if (stream_info->channels > 6)
+                stream_info->bytes_to_read = (FRAME_SIZE_FOR_2CH_PCM * 4);
+            else
+                stream_info->bytes_to_read = (FRAME_SIZE_FOR_2CH_PCM * 3);
         }
         buffer->buffer_parms.input_buf_params.flags = QAP_BUFFER_NO_TSTAMP;
         buffer->common_params.timestamp = QAP_BUFFER_NO_TSTAMP;