pthread_mutex_lock(&uc_mgr->mutex);
if (strcmp(identifier, "_verbs") == 0)
err = get_verb_list(uc_mgr, list);
- else if (strcmp(identifier, "_enadevs"))
+ else if (strcmp(identifier, "_enadevs") == 0)
err = get_enabled_device_list(uc_mgr, list);
- else if (strcmp(identifier, "_enamods"))
+ else if (strcmp(identifier, "_enamods") == 0)
err = get_enabled_modifier_list(uc_mgr, list);
else {
str1 = strchr(identifier, '/');
struct sequence_element *curr;
snd_config_iterator_t i, next;
snd_config_t *n;
- int err;
+ int err, idx = 0;
+ const char *cmd = NULL;
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
uc_error("error: compound is expected for sequence definition");
snd_config_for_each(i, next, cfg) {
const char *id;
+ idx ^= 1;
n = snd_config_iterator_entry(i);
err = snd_config_get_id(n, &id);
if (err < 0)
continue;
+ if (idx == 1) {
+ if (snd_config_get_type(n) != SND_CONFIG_TYPE_STRING) {
+ uc_error("error: string type is expected for sequence command");
+ return -EINVAL;
+ }
+ snd_config_get_string(n, &cmd);
+ continue;
+ }
/* alloc new sequence element */
curr = calloc(1, sizeof(struct sequence_element));
return -ENOMEM;
list_add_tail(&curr->list, base);
- if (strcmp(id, "cset") == 0) {
+ if (strcmp(cmd, "cset") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_CSET;
err = parse_string(n, &curr->data.cset);
if (err < 0) {
continue;
}
- if (strcmp(id, "usleep") == 0) {
+ if (strcmp(cmd, "usleep") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_SLEEP;
err = snd_config_get_integer(n, &curr->data.sleep);
if (err < 0) {
continue;
}
- if (strcmp(id, "exec") == 0) {
+ if (strcmp(cmd, "exec") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_EXEC;
err = parse_string(n, &curr->data.exec);
if (err < 0) {