diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-11-16 11:39:10 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-11-16 11:39:10 +0000 |
commit | 34789cd33f958ac527315a78dc87b7a64f5a6f20 (patch) | |
tree | 18e2ab76234107ac04f34218aa1902d76d49ce1e /src | |
parent | f0f2e7dbcce86e5d79fce0196ef5f3f047890991 (diff) | |
download | xine-lib-34789cd33f958ac527315a78dc87b7a64f5a6f20.tar.gz xine-lib-34789cd33f958ac527315a78dc87b7a64f5a6f20.tar.bz2 |
- 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
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_oss_out.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; |