- if (possible_in == -2) {
- if (possible_out == -1) {
- /* any configuration possible, pick matching */
- FOUNDCFG (preferred_out);
- ANYTHINGGOES;
- } else if (possible_out == -2) {
- /* invalid. interpret as (-1, -1) */
- FOUNDCFG (preferred_out);
- ANYTHINGGOES;
- } else if (possible_out < -2) {
- /* invalid, interpret as (<-2, <-2)
- * variable number of outputs up to -N, */
- FOUNDCFG (min (-possible_out, preferred_out));
- UPTO (-possible_out)
- } else {
- /* exact number of outputs */
- FOUNDCFG (possible_out);
- }
- }
-
- if (possible_in < -2) {
- /* explicit variable number of inputs */
- if (audio_in > -possible_in && imprecise == NULL) {
- /* request is too large */
- } else if (possible_out == -1) {
- /* any output configuration possible */
- FOUNDCFG (preferred_out);
- ANYTHINGGOES;
- } else if (possible_out == -2) {
- /* invalid. interpret as (<-2, -1) */
- FOUNDCFG (preferred_out);
- ANYTHINGGOES;
- } else if (possible_out < -2) {
- /* variable number of outputs up to -N, */
- FOUNDCFG (min (-possible_out, preferred_out));
- UPTO (-possible_out)
+ if (possible_in < -2 || possible_in >= 0) {
+ /* specified number, exact or up to */
+ int desired_in;
+ if (possible_in >= 0) {
+ /* configuration can only match possible_in */
+ desired_in = possible_in;