Skip to content

Instantly share code, notes, and snippets.

@psyke83
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save psyke83/a2f922bf20ff2552d795 to your computer and use it in GitHub Desktop.

Select an option

Save psyke83/a2f922bf20ff2552d795 to your computer and use it in GitHub Desktop.
--- ../../tinyalsa/tinymix.c 2014-07-04 03:53:43.979068284 +0100
+++ ./tinymix.c 2014-07-04 05:12:34.414652590 +0100
@@ -294,11 +294,13 @@
num_values, num_ctl_values);
return;
}
+ int buf[num_values];
for (i = 0; i < num_values; i++) {
- if (mixer_ctl_set_value(ctl, i, atoi(values[i]))) {
- fprintf(stderr, "Error: invalid value for index %d\n", i);
- return;
- }
+ buf[i] = atoi(values[i]);
+ }
+ if (mixer_ctl_set_array(ctl, buf, num_values)) {
+ fprintf(stderr, "Error: failed to set controls");
+ return;
}
}
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment