From 4fc7f9d52eb06a1c16a6af76b3d20db2b06a0d8b Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 21 Jan 2010 01:43:19 +0000 Subject: Require v4l2:/ prefix. --HG-- branch : v4l --- src/input/input_v4l2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/input/input_v4l2.c b/src/input/input_v4l2.c index 1e6da1e78..295e991eb 100644 --- a/src/input/input_v4l2.c +++ b/src/input/input_v4l2.c @@ -333,9 +333,14 @@ typedef struct { static input_plugin_t *v4l2_class_get_instance(input_class_t *gen_cls, xine_stream_t *stream, const char *mrl) { v4l2_input_plugin_t *this; + if (strncasecmp (mrl, "v4l2:/", 6)) + return NULL; + mrl += 5; + while (*++mrl == '/') /**/; + --mrl; /* point at the last slash */ /* TODO: Radio devices */ /* FIXME: Don't require devices to be of /dev/videoXXX */ - if (strncmp(mrl, "/dev/video", strlen("/dev/video")) != 0) + if (strncmp(mrl, "/dev/video", 10) != 0) return NULL; lprintf("We can handle %s!\n", mrl); -- cgit v1.2.3