From 669e53188183bfec2eb8cbda357d43b3f91b3f79 Mon Sep 17 00:00:00 2001 From: MrDave Date: Thu, 2 Mar 2017 18:44:36 -0700 Subject: [PATCH] Camera Type Loosen the names permitted for videodevice --- motion.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/motion.c b/motion.c index b129e8df..89f804ec 100644 --- a/motion.c +++ b/motion.c @@ -720,13 +720,6 @@ static int init_camera_type(struct context *cnt){ return 0; } -#ifdef HAVE_V4L2 - if (strncmp(cnt->conf.video_device,"/dev/video",10) == 0) { - cnt->camera_type = CAMERA_TYPE_V4L2; - return 0; - } -#endif // HAVE_V4L2 - #ifdef HAVE_BKTR if (strncmp(cnt->conf.video_device,"/dev/bktr",9) == 0) { cnt->camera_type = CAMERA_TYPE_BKTR; @@ -734,6 +727,14 @@ static int init_camera_type(struct context *cnt){ } #endif // HAVE_BKTR +#ifdef HAVE_V4L2 + if (cnt->conf.video_device) { + cnt->camera_type = CAMERA_TYPE_V4L2; + return 0; + } +#endif // HAVE_V4L2 + + MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO, "%s: Unable to determine camera type (MMAL, Netcam, V4L2, BKTR)"); return -1;