From: Ben Buchwald Date: Tue, 18 Dec 2018 22:12:30 +0000 (-0500) Subject: module-jackdbus-detect: Allow omitting channels argument X-Git-Tag: v13.99.1~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64211b8f59d48722fbbd359a23a47aa498b076a4;p=platform%2Fupstream%2Fpulseaudio.git module-jackdbus-detect: Allow omitting channels argument 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. --- diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c index 6628102..425b97f 100644 --- a/src/modules/jack/module-jackdbus-detect.c +++ b/src/modules/jack/module-jackdbus-detect.c @@ -234,7 +234,7 @@ int pa__init(pa_module *m) { 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; }