mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2025-10-31 22:25:34 -04:00
Fixed against the current library
This commit is contained in:
parent
14cd95618b
commit
98a80c0ef9
1 changed files with 2 additions and 9 deletions
|
|
@ -37,7 +37,6 @@ int output_open(output_t *output)
|
||||||
{
|
{
|
||||||
const char *pcm_name = output->pcm_name;
|
const char *pcm_name = output->pcm_name;
|
||||||
char devstr[128];
|
char devstr[128];
|
||||||
int card, dev;
|
|
||||||
snd_pcm_hw_params_t *params;
|
snd_pcm_hw_params_t *params;
|
||||||
snd_pcm_sw_params_t *swparams;
|
snd_pcm_sw_params_t *swparams;
|
||||||
snd_pcm_sframes_t buffer_time;
|
snd_pcm_sframes_t buffer_time;
|
||||||
|
|
@ -52,22 +51,16 @@ int output_open(output_t *output)
|
||||||
* Open the device driver
|
* Open the device driver
|
||||||
*/
|
*/
|
||||||
if (pcm_name == NULL) {
|
if (pcm_name == NULL) {
|
||||||
card = snd_defaults_pcm_card();
|
|
||||||
dev = snd_defaults_pcm_device();
|
|
||||||
if (card < 0 || dev < 0) {
|
|
||||||
fprintf(stderr, "defaults are not set\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
switch (output->channels) {
|
switch (output->channels) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(devstr, "default");
|
sprintf(devstr, "default");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
sprintf(devstr, "surround40:%d,%d", card, dev);
|
strcpy(devstr, "surround40");
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
sprintf(devstr, "surround51:%d,%d", card, dev);
|
strcpy(devstr, "surround51");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%d channels are not supported\n", output->channels);
|
fprintf(stderr, "%d channels are not supported\n", output->channels);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue