diff options
author | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-11-07 18:25:35 +0000 |
---|---|---|
committer | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-11-07 18:25:35 +0000 |
commit | f05be1477f462333f8a3ba0be335d14a4260a797 (patch) | |
tree | daf15f2bb3b71fb1c1e3dd7633c6b29411b00f34 /src | |
parent | add9b5e3c1a72850edfc570eaea2ea83102104ce (diff) | |
download | xine-lib-f05be1477f462333f8a3ba0be335d14a4260a797.tar.gz xine-lib-f05be1477f462333f8a3ba0be335d14a4260a797.tar.bz2 |
Allow for some very basic sound cards that do not support "front" device.
Fall back to "default"
CVS patchset: 5702
CVS date: 2003/11/07 18:25:35
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_alsa_out.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index bafb01331..24be52470 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -26,7 +26,7 @@ * (c) 2001 James Courtier-Dutton <James@superbug.demon.co.uk> * * - * $Id: audio_alsa_out.c,v 1.116 2003/10/20 07:04:55 jcdutton Exp $ + * $Id: audio_alsa_out.c,v 1.117 2003/11/07 18:25:35 jcdutton Exp $ */ #ifdef HAVE_CONFIG_H @@ -1379,6 +1379,24 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da snd_pcm_close (this->audio_fd); this->audio_fd=NULL; + +/* Fallback to "default" if device "front" does not exist */ +/* Needed for some very basic sound cards. */ + pcm_device = config->register_string(config, + "audio.alsa_front_device", + "front", + _("device used for stereo output"), + NULL, + 10, NULL, + NULL); + err=snd_pcm_open(&this->audio_fd, pcm_device, SND_PCM_STREAM_PLAYBACK, 1); /* NON-BLOCK mode */ + if(err <0 ) { + config->update_string(config, "audio.alsa_front_device", "default"); + } else { + snd_pcm_close (this->audio_fd); + this->audio_fd=NULL; + } + this->output_sample_rate = 0; if (config->register_bool (config, "audio.a52_pass_through", |