diff options
author | wm4 <wm4@nowhere> | 2013-11-30 18:58:18 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-30 18:58:18 +0100 |
commit | ac0cbd7c5eef42d68b9a420fcc8fd8fe4b8bd90b (patch) | |
tree | 60aa2c58da42325bccec4712bbd31187ae60a500 /audio/out | |
parent | 17d72de2ac16ba78d05b2210112fa2c4335cf1f9 (diff) | |
download | mpv-ac0cbd7c5eef42d68b9a420fcc8fd8fe4b8bd90b.tar.bz2 mpv-ac0cbd7c5eef42d68b9a420fcc8fd8fe4b8bd90b.tar.xz |
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.
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_oss.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index b1f2028af2..3d05414a5f 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -437,10 +437,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); |