+}
+
+static int set_initial_volume(struct mixer *m, struct mixer_handle *h)
+{
+ int i, ret;
+
+ for (i = 0; i < conf.ivol_given; i++) {
+ char *p, *ch, *arg = para_strdup(conf.ivol_arg[i]);
+ int32_t iv;
+ p = strchr(arg, ':');
+ if (p) {
+ *p = '\0';
+ p++;
+ ch = arg;
+ } else {
+ p = arg;
+ ch = NULL;
+ }
+ ret = para_atoi32(p, &iv);
+ if (ret < 0) {
+ free(arg);
+ return ret;
+ }
+ ret = set_channel(m, h, ch);
+ if (!ch)
+ ch = "default";
+ if (ret < 0) {
+ PARA_WARNING_LOG("ignoring channel %s\n", ch);
+ ret = 0;
+ } else {
+ PARA_INFO_LOG("initial volume %s: %d\n", ch, iv);
+ ret = m->set(h, iv);
+ }
+ free(arg);
+ if (ret < 0)
+ return ret;
+ }
+ return 1;