diff options
author | Luigi Rizzo <rizzo@icir.org> | 2008-06-29 12:53:45 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2008-06-29 12:53:45 +0000 |
commit | 03e7978a1a251992208a1be0d5d7c0f71b1eb5be (patch) | |
tree | f81a4c1923252b745854a15c4301be22d2eb2e06 /channels/vgrabbers.c | |
parent | e6f17e50c43177fccb5091c75894627ae2fc2376 (diff) |
accept any name starting with X11 for X11 grabbers - this lets
you have multiple active instances of this grabber;
require v4l device names to start with '/dev/' - prevents some useless
attempt to open a file as a device.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/vgrabbers.c')
-rw-r--r-- | channels/vgrabbers.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/vgrabbers.c b/channels/vgrabbers.c index 0e4e62f56..470a19f38 100644 --- a/channels/vgrabbers.c +++ b/channels/vgrabbers.c @@ -79,7 +79,8 @@ static void *grab_x11_open(const char *name, struct fbuf_t *geom, int fps) struct grab_x11_desc *v; struct fbuf_t *b; - if (strcasecmp(name, "X11")) + /* all names starting with X11 identify this grabber */ + if (strncasecmp(name, "X11", 3)) return NULL; /* not us */ v = ast_calloc(1, sizeof(*v)); if (v == NULL) @@ -205,6 +206,9 @@ static void *grab_v4l1_open(const char *dev, struct fbuf_t *geom, int fps) struct grab_v4l1_desc *v; struct fbuf_t *b; + /* name should be something under /dev/ */ + if (strncmp(dev, "/dev/", 5)) + return NULL; fd = open(dev, O_RDONLY | O_NONBLOCK); if (fd < 0) { ast_log(LOG_WARNING, "error opening camera %s\n", dev); |