diff options
author | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-09-01 00:51:45 +0000 |
---|---|---|
committer | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-09-01 00:51:45 +0000 |
commit | b9eb785a112c0a759fc30152a88ee2e9f38a11f2 (patch) | |
tree | 152f6f62c5e4a1f0baed28058e7f45e1148eb9eb /src | |
parent | 14cb475d6b31c18077077410aeabb2cd4fb3909e (diff) | |
download | xine-lib-b9eb785a112c0a759fc30152a88ee2e9f38a11f2.tar.gz xine-lib-b9eb785a112c0a759fc30152a88ee2e9f38a11f2.tar.bz2 |
Allow a52 passthru to be switchied on and off without having to exit xine.
One has to stop playing, and then restart playing for it to activate.
CVS patchset: 5323
CVS date: 2003/09/01 00:51:45
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_alsa_out.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 8ba2b7489..09a13fe15 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.104 2003/08/31 17:56:24 jcdutton Exp $ + * $Id: audio_alsa_out.c,v 1.105 2003/09/01 00:51:45 jcdutton Exp $ */ #ifdef HAVE_CONFIG_H @@ -381,6 +381,7 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int printf ("audio_alsa_out: >>> check if another program don't already use PCM <<<\n"); return 0; } + /* printf ("audio_alsa_out: snd_pcm_open() opened %s\n", pcm_device); */ /* We wanted non blocking open but now put it back to normal */ //snd_pcm_nonblock(this->audio_fd, 0); snd_pcm_nonblock(this->audio_fd, 1); @@ -1140,6 +1141,19 @@ static void ao_alsa_mixer_init(ao_driver_t *this_gen) { } +static void alsa_passthru_cb (void *user_data, + xine_cfg_entry_t *entry) { + alsa_driver_t *this = (alsa_driver_t *) user_data; + int32_t value = entry->num_value; + if (value) { + this->capabilities |= AO_CAP_MODE_A52; + this->capabilities |= AO_CAP_MODE_AC5; + } else { + this->capabilities &= ~AO_CAP_MODE_A52; + this->capabilities &= ~AO_CAP_MODE_AC5; + } +} + /* * Initialize plugin */ @@ -1323,8 +1337,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da 0, _("used to inform xine about what the sound card can do"), NULL, - 0, NULL, - NULL) ) { + 0, alsa_passthru_cb, + this) ) { this->capabilities |= AO_CAP_MODE_A52; this->capabilities |= AO_CAP_MODE_AC5; if (class->xine->verbosity >= XINE_VERBOSITY_LOG) |