[Mplayer-cvslog] CVS: main/libao2 ao_oss.c,1.14,1.15

Stephen Davies steve at mplayer.dev.hu
Tue Dec 4 18:54:10 CET 2001


Update of /cvsroot/mplayer/main/libao2
In directory mplayer:/var/tmp.root/cvs-serv24547/libao2

Modified Files:
	ao_oss.c 
Log Message:
fixed to check that SNDCTL_DSP_CHANNELS actually grants the requested number of channels

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ao_oss.c	28 Nov 2001 12:46:23 -0000	1.14
+++ ao_oss.c	4 Dec 2001 17:54:08 -0000	1.15
@@ -129,8 +129,9 @@
     // 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 @@
 	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);




More information about the MPlayer-cvslog mailing list