ac3dec - Add -H option for HDMI

The HD-audio can have an independent HDMI PCM device via "hdmi".
The option -H is for using hdmi instead of spdif.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2008-10-24 09:24:32 +02:00
parent 0478bb19e1
commit 1ffbd0ab28
3 changed files with 20 additions and 3 deletions

View file

@ -41,6 +41,7 @@ int output_open(output_t *output)
{
const char *pcm_name = output->pcm_name;
char devstr[128];
const char *basedev;
snd_pcm_hw_params_t *params;
unsigned int rate, buffer_time, period_time, tmp;
snd_pcm_format_t format = output->bits == 16 ? SND_PCM_FORMAT_S16 : SND_PCM_FORMAT_U8;
@ -76,9 +77,18 @@ int output_open(output_t *output)
s[2] = 0;
s[3] = IEC958_AES3_CON_FS_48000;
}
sprintf(devstr, "plug:iec958:{AES0 0x%x AES1 0x%x AES2 0x%x AES3 0x%x", s[0], s[1], s[2], s[3]);
if (output->hdmi)
basedev = "hdmi";
else
basedev = "iec958";
sprintf(devstr, "plug:%s:{"
"AES0 0x%x AES1 0x%x "
"AES2 0x%x AES3 0x%x",
basedev,
s[0], s[1], s[2], s[3]);
if (out_config.card)
sprintf(devstr + strlen(devstr), " CARD %s", out_config.card);
sprintf(devstr + strlen(devstr),
" CARD %s", out_config.card);
strcat(devstr, "}");
format = SND_PCM_FORMAT_S16_LE;
} else {