- const char *key = 0;
- const char *val = 0;
- uint32_t fcc = 0;
- JSON_Value_Type type;
-
- key = json_object_get_name(root, i);
- type = json_value_get_type(json_object_get_value(root, key));
- if (type == JSONString)
- val = json_object_get_string(root, key);
- else if (type == JSONNumber) {
- double num = json_object_get_number(root, key);
- sprintf(buf, "%g", num);
- val = buf;
- } else if (type == JSONBoolean) {
- int n = json_object_get_boolean(root, key);
- sprintf(buf, "%d", n);
- val = buf;
- }
- fcc = get_tag_fcc_from_name(key);
+ const char *key = json_object_get_name(root, i);
+ const char *val = aacenc_json_object_get_string(root, key, buf);
+ uint32_t fcc = get_tag_fcc_from_name(key);