From: James Courtier-D. <jcd...@us...> - 2003-09-01 00:51:48
|
Update of /cvsroot/xine/xine-lib/src/audio_out In directory sc8-pr-cvs1:/tmp/cvs-serv30476/xine-lib/src/audio_out Modified Files: audio_alsa_out.c Log Message: 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. Index: audio_alsa_out.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/audio_out/audio_alsa_out.c,v retrieving revision 1.104 retrieving revision 1.105 diff -u -r1.104 -r1.105 --- audio_alsa_out.c 31 Aug 2003 17:56:24 -0000 1.104 +++ audio_alsa_out.c 1 Sep 2003 00:51:45 -0000 1.105 @@ -381,6 +381,7 @@ 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 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 @@ 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) |