From 34789cd33f958ac527315a78dc87b7a64f5a6f20 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sat, 16 Nov 2002 11:39:10 +0000 Subject: - return -1 if there is no mixer available so that xine-ui gets the capabilities correct - after testing 8bit mode, switch back to 16bits, because some cards might not report all their capabilities otherwise (inspired by work of theo@kluter.net) CVS patchset: 3270 CVS date: 2002/11/16 11:39:10 --- src/audio_out/audio_oss_out.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 3135611d8..bde236e99 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_oss_out.c,v 1.80 2002/11/12 00:32:29 guenter Exp $ + * $Id: audio_oss_out.c,v 1.81 2002/11/16 11:39:10 mroi Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -507,6 +507,7 @@ static int ao_oss_get_property (xine_ao_driver_t *this_gen, int property) { else printf("%s(): open() %s failed: %s\n", __XINE_FUNCTION__, this->mixer.name, strerror(errno)); + return -1; } return this->mixer.volume; break; @@ -813,6 +814,14 @@ static xine_ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const voi bits = 8; if( ioctl(audio_fd, SNDCTL_DSP_SAMPLESIZE,&bits) != -1 ) this->capabilities |= AO_CAP_8BITS; + + /* switch back to 16bits, because some soundcards otherwise do not report all their capabilities */ + bits = 16; + if (ioctl(audio_fd, SNDCTL_DSP_SAMPLESIZE, &bits) == -1) { + printf("audio_oss_out: switching the soundcard to 16 bits mode failed\n"); + free(this); + return NULL; + } printf ("audio_oss_out : supported modes are "); num_channels = 1; -- cgit v1.2.3