From 228b652ad53be0887044224c90397a2a6aabc30e Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 30 Nov 2013 18:58:18 +0100 Subject: ao_oss: SNDCTL_DSP_CHANNELS takes int, not uint8_t This caused weird issue, probably caused by setting up the wrong number of channels, or similar. See github issue #383. Patch by bugmen0t on github. --- audio/out/ao_oss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 5050f9771f..247667a11f 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -430,10 +430,11 @@ static void reset(struct ao *ao) ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &ao->samplerate); ioctl(p->audio_fd, SNDCTL_DSP_SETFMT, &oss_format); if (!AF_FORMAT_IS_AC3(ao->format)) { + int c = ao->channels.num; if (ao->channels.num > 2) - ioctl(p->audio_fd, SNDCTL_DSP_CHANNELS, &ao->channels.num); + ioctl(p->audio_fd, SNDCTL_DSP_CHANNELS, &c); else { - int c = ao->channels.num - 1; + c--; ioctl(p->audio_fd, SNDCTL_DSP_STEREO, &c); } ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &ao->samplerate); -- cgit v1.2.3