append _in _out to mic/spkr/hp/... only

This commit is contained in:
Alexandre Ratchov 2015-03-06 10:39:51 +01:00
parent 99ca91c6b3
commit 0c4e64484d
1 changed files with 11 additions and 7 deletions

View File

@ -213,21 +213,25 @@ copy_ch(struct siomix_sun_hdl *hdl,
if (icls == -1)
return 1;
/*
* append "-in" and "-out" suffixes, as nowadays
* append "_in" and "_out" suffixes, as nowadays
* most jacks are bidirectional
*/
if (icls == hdl->iclass)
strlcat(ostr, "-in", SIOMIX_NAMEMAX);
if (icls == hdl->oclass)
strlcat(ostr, "-out", SIOMIX_NAMEMAX);
if (strcmp(ostr, "mic") == 0 ||
strcmp(ostr, "spkr") == 0 ||
strcmp(ostr, "hp") == 0 ||
strcmp(ostr, "line") == 0) {
if (icls == hdl->iclass)
strlcat(ostr, "_in", SIOMIX_NAMEMAX);
if (icls == hdl->oclass)
strlcat(ostr, "_out", SIOMIX_NAMEMAX);
}
/*
* record class may conflict with input/output
*/
if (icls == hdl->rclass) {
if (strcmp(ostr, "volume") == 0)
strlcpy(ostr, "rec", SIOMIX_NAMEMAX);
else
strlcat(ostr, "-rec", SIOMIX_NAMEMAX);
}
return 1;
}