mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2026-03-27 07:58:28 -04:00
fixed -c option
This commit is contained in:
parent
40cfde62d7
commit
295539577d
2 changed files with 7 additions and 3 deletions
|
|
@ -101,7 +101,7 @@ int main(int argc,char *argv[])
|
||||||
{"device", 1, NULL, 'D'},
|
{"device", 1, NULL, 'D'},
|
||||||
{"4ch", 0, NULL, '4'},
|
{"4ch", 0, NULL, '4'},
|
||||||
{"6ch", 0, NULL, '6'},
|
{"6ch", 0, NULL, '6'},
|
||||||
{"card", 0, NULL, 'c'},
|
{"card", 1, NULL, 'c'},
|
||||||
{"iec958c", 0, NULL, 'C'},
|
{"iec958c", 0, NULL, 'C'},
|
||||||
{"spdif", 0, NULL, 'C'},
|
{"spdif", 0, NULL, 'C'},
|
||||||
{"iec958p", 0, NULL, 'P'},
|
{"iec958p", 0, NULL, 'P'},
|
||||||
|
|
@ -131,7 +131,7 @@ int main(int argc,char *argv[])
|
||||||
while (1) {
|
while (1) {
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
if ((c = getopt_long(argc, argv, "hvcD:46CPRZ:q", long_option, NULL)) < 0)
|
if ((c = getopt_long(argc, argv, "hvc:D:46CPRZ:q", long_option, NULL)) < 0)
|
||||||
break;
|
break;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ int output_open(output_t *output)
|
||||||
switch (output->channels) {
|
switch (output->channels) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(devstr, "default");
|
|
||||||
if (output->spdif != SPDIF_NONE) {
|
if (output->spdif != SPDIF_NONE) {
|
||||||
unsigned char s[4];
|
unsigned char s[4];
|
||||||
if (output->spdif == SPDIF_PRO) {
|
if (output->spdif == SPDIF_PRO) {
|
||||||
|
|
@ -76,6 +75,11 @@ int output_open(output_t *output)
|
||||||
sprintf(devstr, "iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", s[0], s[1], s[2], s[3]);
|
sprintf(devstr, "iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", s[0], s[1], s[2], s[3]);
|
||||||
if (out_config.card)
|
if (out_config.card)
|
||||||
sprintf(devstr + strlen(devstr), ",CARD=%s", out_config.card);
|
sprintf(devstr + strlen(devstr), ",CARD=%s", out_config.card);
|
||||||
|
} else {
|
||||||
|
if (out_config.card)
|
||||||
|
sprintf(devstr, "plughw:%s", out_config.card);
|
||||||
|
else
|
||||||
|
sprintf(devstr, "default");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue