[svn-commits] rizzo: trunk r126309 - /trunk/channels/vgrabbers.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jun 29 07:53:45 CDT 2008


Author: rizzo
Date: Sun Jun 29 07:53:45 2008
New Revision: 126309

URL: http://svn.digium.com/view/asterisk?view=rev&rev=126309
Log:
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.

Modified:
    trunk/channels/vgrabbers.c

Modified: trunk/channels/vgrabbers.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/vgrabbers.c?view=diff&rev=126309&r1=126308&r2=126309
==============================================================================
--- trunk/channels/vgrabbers.c (original)
+++ trunk/channels/vgrabbers.c Sun Jun 29 07:53:45 2008
@@ -79,7 +79,8 @@
 	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 @@
 	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);




More information about the svn-commits mailing list