module-jackdbus-detect documents the channels argument as optional and "if
omitted, the sink wil use the number of physical output port and the source
will use the number of physical input ports registered in the JACK server."
However, although it would correctly omit the channels argument to
module-jack-sink and module-jack-source if its channel argument was omitted,
its argument validation was broken to consider omitting channels an error.
This commit properly validates the channels argument so omitting it is
accepted.
goto fail;
}
- if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 || !pa_channels_valid(u->channels)) {
+ if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 || (u->channels > 0 && !pa_channels_valid(u->channels))) {
pa_log("Failed to parse channels= argument.");
goto fail;
}