diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-26 17:42:56 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-26 17:42:56 +0000 |
commit | c018c8408df06dcf47c2c924e0b88a6a048573de (patch) | |
tree | 7e775faa5414139a1298194fc177fa2431ab5321 | |
parent | b6dfc3fc918b6067028121e660341c623942ced1 (diff) | |
download | xine-lib-c018c8408df06dcf47c2c924e0b88a6a048573de.tar.gz xine-lib-c018c8408df06dcf47c2c924e0b88a6a048573de.tar.bz2 |
Quick hack to allow configuration of the V4L ALSA audio input device.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/input/input_v4l.c | 21 |
2 files changed, 19 insertions, 3 deletions
@@ -15,6 +15,7 @@ xine-lib (1.1.10) (unreleased) * Don't discard audio samples forever. Fixed streaming playback. * Fix a possible crash on channel change in the DVB plugin. * Flash video demuxer improvements and bug fixes. + * Make the V4L ALSA audio input device configurable. (This needs more work.) xine-lib (1.1.9.1) 2008-01-11 * Security fixes: diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index 34f6a0684..d0558b492 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -93,6 +93,9 @@ static const resolution_t resolutions[] = { #define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0])) #define RADIO_DEV "/dev/radio0" #define VIDEO_DEV "/dev/video0" +#ifdef HAVE_ALSA +#define AUDIO_DEV "plughw:0,0" +#endif #if !defined(NDELAY) && defined(O_NDELAY) #define FNDELAY O_NDELAY @@ -1701,6 +1704,9 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen, { /* v4l_input_class_t *cls = (v4l_input_class_t *) cls_gen; */ v4l_input_plugin_t *this; +#ifdef HAVE_ALSA + cfg_entry_t *entry; +#endif char *mrl = strdup(data); /* Example mrl: v4l:/Television/62500 */ @@ -1721,13 +1727,14 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen, this->event_queue = NULL; this->scr = NULL; #ifdef HAVE_ALSA - this->pcm_name = NULL; this->pcm_data = NULL; this->pcm_hwparams = NULL; /* Audio */ this->pcm_stream = SND_PCM_STREAM_CAPTURE; - this->pcm_name = strdup("plughw:0,0"); + entry = this->stream->xine->config->lookup_entry(this->stream->xine->config, + "media.video4linux.audio_device"); + this->pcm_name = strdup (entry->str_value); this->audio_capture = 1; #endif this->rate = 44100; @@ -1910,7 +1917,15 @@ static void *init_video_class (xine_t *xine, void *data) _("v4l video device"), _("The path to your Video4Linux video device."), 10, NULL, NULL); - +#ifdef HAVE_ALSA + config->register_filename (config, "media.video4linux.audio_device", + AUDIO_DEV, 0, + _("v4l ALSA audio input device"), + _("The name of the audio device which corresponds " + "to your Video4Linux video device."), + 10, NULL, NULL); +#endif + return this; } |