diff options
author | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-06-01 22:48:26 +0000 |
---|---|---|
committer | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-06-01 22:48:26 +0000 |
commit | 32fd2077b3b9317c7f96e7491f5d1326e176aad9 (patch) | |
tree | 2a6d1756dddf9c679273164c6630e921bdc7d77e /src | |
parent | af85be8db56a088a7689baf9f4d1d67c2ee0decf (diff) | |
download | xine-lib-32fd2077b3b9317c7f96e7491f5d1326e176aad9.tar.gz xine-lib-32fd2077b3b9317c7f96e7491f5d1326e176aad9.tar.bz2 |
Work around for users with an oss sound card with spdif, but the sound
card incorrectly reports AFMT_AC3 as being absent.
In effect, this forces xine to send non-audio AC3 and DTS data to the sound card,
without ever knowing if the spdif is working or not.
Can cause horrible noise to come out of speakers, and might even damage speakers.
CVS patchset: 4995
CVS date: 2003/06/01 22:48:26
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_oss_out.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 6d38d51f6..4287999d9 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.88 2003/03/27 11:39:23 siggi Exp $ + * $Id: audio_oss_out.c,v 1.89 2003/06/01 22:48:26 jcdutton Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -309,10 +309,18 @@ static int ao_oss_open(ao_driver_t *this_gen, break; case AO_CAP_MODE_A52: case AO_CAP_MODE_AC5: + tmp = bits; + ioctl(this->audio_fd,SNDCTL_DSP_SAMPLESIZE,&tmp); + + tmp = this->input_sample_rate; + ioctl(this->audio_fd,SNDCTL_DSP_SPEED, &tmp); + tmp = 2; + ioctl(this->audio_fd, SNDCTL_DSP_CHANNELS, &tmp); tmp = AFMT_AC3; if (ioctl(this->audio_fd, SNDCTL_DSP_SETFMT, &tmp) < 0 || tmp != AFMT_AC3) { - printf("audio_oss_out: AC3 SNDCTL_DSP_SETFMT failed. %d\n",tmp); - return 0; + printf("audio_oss_out: AC3 SNDCTL_DSP_SETFMT failed. %d. Using alternative.\n",tmp); + tmp = AFMT_S16_LE; + ioctl(this->audio_fd, SNDCTL_DSP_SETFMT, &tmp); } break; } @@ -923,9 +931,12 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da } ioctl(audio_fd,SNDCTL_DSP_GETFMTS,&caps); - if (caps & AFMT_AC3) { + + if ((caps & AFMT_AC3) || config->register_bool (config, "audio.oss_pass_through_bug", 0, + _("used to inform xine about what the sound card can do"), + NULL, 0, NULL, NULL)) { if (config->register_bool (config, "audio.a52_pass_through", 0, - _("Enable A52 / AC5 digital audio output via spdif"), + _("used to inform xine about what the sound card can do"), NULL, 0, NULL, NULL)) { this->capabilities |= AO_CAP_MODE_A52; this->capabilities |= AO_CAP_MODE_AC5; |