summaryrefslogtreecommitdiffstats
path: root/libao2/ao_oss.c
diff options
context:
space:
mode:
authorsteve <steve@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-04 17:54:08 +0000
committersteve <steve@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-04 17:54:08 +0000
commitd18cf2ade306e1579bb9182953314e2448aebfc6 (patch)
treeecaacefa74ad6bddee1df2ffd89ce32be64eb919 /libao2/ao_oss.c
parentede059fec241042843f377acd34d504334d1b5da (diff)
downloadmpv-d18cf2ade306e1579bb9182953314e2448aebfc6.tar.bz2
mpv-d18cf2ade306e1579bb9182953314e2448aebfc6.tar.xz
fixed to check that SNDCTL_DSP_CHANNELS actually grants the requested number of channels
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3320 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_oss.c')
-rw-r--r--libao2/ao_oss.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c
index aad1c943d6..a0675cbdcc 100644
--- a/libao2/ao_oss.c
+++ b/libao2/ao_oss.c
@@ -129,8 +129,9 @@ static int init(int rate,int channels,int format,int flags){
// We only use SNDCTL_DSP_CHANNELS for >2 channels, in case some drivers don't have it
ao_data.channels = channels;
if (ao_data.channels > 2) {
- if (ioctl (audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels) == -1) {
- printf("audio_setup: Failed to set audio device to %d channels\n", ao_data.channels);
+ if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels) == -1 ||
+ ao_data.channels != channels ) {
+ printf("audio_setup: Failed to set audio device to %d channels\n", channels);
return 0;
}
}
@@ -141,7 +142,7 @@ static int init(int rate,int channels,int format,int flags){
return 0;
}
}
- printf("audio_setup: using %d channels (requested: %d)\n", ao_data.channels, ao_data.channels);
+ printf("audio_setup: using %d channels (requested: %d)\n", ao_data.channels, channels);
// set rate
ao_data.samplerate=rate;
ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate);