strtok stores its values in thread local storage.
So it can not guarantee works well when multithread environment.
AudioFlinger has multithread.
so strtok_r is more safe.

Change-Id: I6d77ef9cc49a4478dd856dcdca14e4920ce955c6
diff --git a/media/libmedia/AudioParameter.cpp b/media/libmedia/AudioParameter.cpp
index e3fea77..33dbf0b 100644
--- a/media/libmedia/AudioParameter.cpp
+++ b/media/libmedia/AudioParameter.cpp
@@ -37,9 +37,10 @@
 {
     char *str = new char[keyValuePairs.length()+1];
     mKeyValuePairs = keyValuePairs;
+    char *last;
 
     strcpy(str, keyValuePairs.string());
-    char *pair = strtok(str, ";");
+    char *pair = strtok_r(str, ";", &last);
     while (pair != NULL) {
         if (strlen(pair) != 0) {
             size_t eqIdx = strcspn(pair, "=");
@@ -58,7 +59,7 @@
         } else {
             ALOGV("AudioParameter() cstor empty key value pair");
         }
-        pair = strtok(NULL, ";");
+        pair = strtok_r(NULL, ";", &last);
     }
 
     delete[] str;