From d18cf2ade306e1579bb9182953314e2448aebfc6 Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 4 Dec 2001 17:54:08 +0000 Subject: 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 --- libao2/ao_oss.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libao2') 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); -- cgit v1.2.3