Unbreak sound output on NetBSD

master
shattered 13 years ago
parent f8fb334075
commit a874e9ca6d
  1. 6
      src/sound_netbsd.c

@ -68,21 +68,23 @@ static int init(struct options *options)
AUDIO_INITINFO(&ainfo);
ainfo.mode = AUMODE_PLAY_ALL;
ainfo.play.sample_rate = options->rate;
ainfo.play.channels = options->format & XMP_FORMAT_MONO ? 1 : 2;
if (options->format & XMP_FORMAT_8BIT) {
ainfo.play.precision = 8;
ainfo.play.precision = AUDIO_ENCODING_ULINEAR;
ainfo.play.encoding = AUDIO_ENCODING_ULINEAR;
options->format |= XMP_FORMAT_UNSIGNED;
} else {
ainfo.play.precision = 16;
ainfo.play.precision = AUDIO_ENCODING_SLINEAR;
ainfo.play.encoding = AUDIO_ENCODING_SLINEAR;
options->format &= ~XMP_FORMAT_UNSIGNED;
}
ainfo.play.gain = gain;
ainfo.play.buffer_size = bsize;
ainfo.blocksize = 0;
if (ioctl(audio_fd, AUDIO_SETINFO, &ainfo) == -1) {
close(audio_fd);

Loading…
Cancel
Save