13
0

Remove ad-hoc handling of possible_in == 0

Just make the code responsible for possible_in > 0 also handle
possible_in == 0 since it nearly does the same thing.

The only difference is that the possible_in == 0 case, by using
FOUNDCFG(), acted as if possible_in was audio_in. The consolidated code
uses FOUNDCFG_IMPRECISE which will add some penalty to the
configurations where desired_in == possible_in != audio_in.

There is thus a small POLICY CHANGE, but the selected configuration will
stay the same unless a better matching configuration is available.
This commit is contained in:
Julien "_FrnchFrgg_" RIVAUD 2018-08-01 11:40:52 +02:00
parent 3bff40b5b3
commit fe4d0f67e4

View File

@ -1430,23 +1430,6 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha
} }
/* now allow potentially "imprecise" matches */ /* now allow potentially "imprecise" matches */
if (possible_in == 0) {
/* no inputs, generators & instruments */
if (possible_out == -1 || possible_out == -2) {
/* any output configuration possible
* out == -2 is invalid, interpreted as out == -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);
} else {
/* exact number of outputs */
FOUNDCFG (possible_out);
}
}
if (possible_in == -1 || possible_in == -2) { if (possible_in == -1 || possible_in == -2) {
/* wildcard for input */ /* wildcard for input */
if (possible_out == possible_in) { if (possible_out == possible_in) {
@ -1469,10 +1452,10 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha
} }
} }
if (possible_in < -2 || possible_in > 0) { if (possible_in < -2 || possible_in >= 0) {
/* specified number, exact or up to */ /* specified number, exact or up to */
int32_t desired_in; int32_t desired_in;
if (possible_in > 0) { if (possible_in >= 0) {
/* configuration can only match possible_in */ /* configuration can only match possible_in */
desired_in = possible_in; desired_in = possible_in;
} else { } else {