| @@ -63,7 +63,7 @@ static void linux_close (AUDIO_OUT *audio_out) ; · 62 unmodified lines |
| 63 | static AUDIO_OUT * | 63 | static AUDIO_OUT * |
| 64 | linux_open (int channels, int samplerate) | 64 | linux_open (int channels, int samplerate) |
| 65 | { LINUX_AUDIO_OUT *linux_out ; | 65 | { LINUX_AUDIO_OUT *linux_out ; |
| 66 | int stereo, temp, error ; | 66 | int stereo, fmt, error ; |
| 67 | | 67 | |
| 68 | if ((linux_out = malloc (sizeof (LINUX_AUDIO_OUT))) == NULL) | 68 | if ((linux_out = malloc (sizeof (LINUX_AUDIO_OUT))) == NULL) |
| 69 | { perror ("linux_open : malloc ") ; | 69 | { perror ("linux_open : malloc ") ; |
| @@ -90,11 +90,11 @@ linux_open (int channels, int samplerate) · 20 unmodified lines |
| 90 | exit (1) ; | 90 | exit (1) ; |
| 91 | } ; | 91 | } ; |
| 92 | | 92 | |
| 93 | temp = 16 ; | 93 | fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ; |
| 94 | if ((error = ioctl (linux_out->fd, SOUND_PCM_WRITE_BITS, &temp)) != 0) | 94 | if (ioctl (fd, SOUND_PCM_SETFMT, &fmt) != 0) |
| 95 | { perror ("linux_open : bitwidth ") ; | 95 | { perror ("linux_open_dsp_device : set format ") ; |
| 96 | exit (1) ; | 96 | exit (1) ; |
| 97 | } ; | 97 | } ; |
| 98 | | 98 | |
| 99 | if ((error = ioctl (linux_out->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0) | 99 | if ((error = ioctl (linux_out->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0) |
| 100 | { perror ("linux_open : channels ") ; | 100 | { perror ("linux_open : channels ") ; |