summaryrefslogtreecommitdiff
path: root/src/input/input_v4l.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-06-19 14:24:27 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-06-19 14:24:27 +0100
commitd2774e48780a6350b7435b5975397e0234e300bf (patch)
tree6b28f20b0c2b39422c92caaac71b936fca7989f6 /src/input/input_v4l.c
parent15eb883def371a660ee8c9e8f47edb164d0a7feb (diff)
parent048c41a4661a6fffc5a4842390902493eea82168 (diff)
downloadxine-lib-d2774e48780a6350b7435b5975397e0234e300bf.tar.gz
xine-lib-d2774e48780a6350b7435b5975397e0234e300bf.tar.bz2
Merge from 1.1, dropping the channels.conf patch for XDG-related reasons.
--HG-- rename : m4/_xine.m4 => m4/types.m4 rename : po/libxine1.pot => po/libxine2.pot
Diffstat (limited to 'src/input/input_v4l.c')
-rw-r--r--src/input/input_v4l.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index bbd594418..302b96b57 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -110,9 +110,6 @@ static const resolution_t resolutions[] = {
{ 160, 120 }
};
-static const char *const tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL };
-static const int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM };
-
#define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0]))
#define RADIO_DEV "/dev/radio0"
#define VIDEO_DEV "/dev/video0"
@@ -120,6 +117,9 @@ static const int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO
#define AUDIO_DEV "plughw:0,0"
#endif
+static const char *const tv_standard_names[] = { "AUTO", "PAL", "NTSC", "SECAM", "OLD", NULL };
+static const int tv_standard_values[] = { VIDEO_MODE_AUTO, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM, -1 };
+
#if !defined(NDELAY) && defined(O_NDELAY)
#define FNDELAY O_NDELAY
#endif
@@ -694,11 +694,14 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source)
tv_standard_entry = this->stream->xine->config->lookup_entry(this->stream->xine->config,
"media.video4linux.tv_standard");
this->tuner_name = input_source;
- this->video_channel.norm = tv_standard_values[ tv_standard_entry->num_value ];
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- "input_v4l: TV Standard configured as STD %s (%d)\n",
- tv_standard_names[ tv_standard_entry->num_value ], this->video_channel.norm );
- ret = ioctl(fd, VIDIOCSCHAN, &this->video_channel);
+ if (tv_standard_entry->num_value != 0) {
+ this->video_channel.norm = tv_standard_values[ tv_standard_entry->num_value ];
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "input_v4l: TV Standard configured as STD %s (%d)\n",
+ tv_standard_names[ tv_standard_entry->num_value ], this->video_channel.norm );
+ ret = ioctl(fd, VIDIOCSCHAN, &this->video_channel);
+ } else
+ ret = ioctl(fd, VIDIOCSCHAN, &this->input);
lprintf("(%d) Set channel to %d\n", ret, this->input);
@@ -1912,12 +1915,6 @@ static void *init_video_class (xine_t *xine, void *data)
_("v4l video device"),
_("The path to your Video4Linux video device."),
10, NULL, NULL);
-
- config->register_enum (config, "media.video4linux.tv_standard", 0,
- tv_standard_names, _("v4l TV standard"),
- _("Selects the TV standard of the input signals. "
- "Either: PAL, NTSC and SECAM. "), 20, NULL, NULL);
-
#ifdef HAVE_ALSA
config->register_filename (config, "media.video4linux.audio_device",
AUDIO_DEV, 0,
@@ -1925,7 +1922,11 @@ static void *init_video_class (xine_t *xine, void *data)
_("The name of the audio device which corresponds "
"to your Video4Linux video device."),
10, NULL, NULL);
-#endif
+#endif
+ config->register_enum (config, "media.video4linux.tv_standard", 0 /* auto */,
+ tv_standard_names, _("v4l TV standard"),
+ _("Selects the TV standard of the input signals. "
+ "Either: AUTO, PAL, NTSC or SECAM. "), 20, NULL, NULL);
return this;
}