diff options
author | Siggi Langauf <siggi@users.sourceforge.net> | 2003-12-31 12:05:26 +0000 |
---|---|---|
committer | Siggi Langauf <siggi@users.sourceforge.net> | 2003-12-31 12:05:26 +0000 |
commit | b62d628a841ff67097c82361885780970210e8c4 (patch) | |
tree | 787bbe4103ee1599c6979e0a083966bec03265c7 /src | |
parent | 1a68e49266a0a5b90e06178ff6333236c0ffefea (diff) | |
download | xine-lib-b62d628a841ff67097c82361885780970210e8c4.tar.gz xine-lib-b62d628a841ff67097c82361885780970210e8c4.tar.bz2 |
fix driver initialization on big endian platforms that don't support little
endian audio samples
CVS patchset: 5964
CVS date: 2003/12/31 12:05:26
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_oss_out.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index fecfaef6c..a04dc5c87 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.98 2003/12/14 22:13:22 siggi Exp $ + * $Id: audio_oss_out.c,v 1.99 2003/12/31 12:05:26 siggi Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -848,15 +848,16 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da this->capabilities = 0; - bits = 8; - if( ioctl(audio_fd, SNDCTL_DSP_SAMPLESIZE,&bits) != -1 && bits == 8) + arg = AFMT_U8; + if( ioctl(audio_fd, SOUND_PCM_SETFMT, &arg) != -1 && arg == AFMT_U8) 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) { + arg = AFMT_S16_NE; + if (ioctl(audio_fd, SOUND_PCM_SETFMT, &arg) == -1 || arg != AFMT_S16_NE) { xprintf(class->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: switching the soundcard to 16 bits mode failed\n"); free(this); + close(audio_fd); return NULL; } |