diff --git a/CHANGELOG b/CHANGELOG index 8c00a44..800b3d5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -44,6 +44,7 @@ Features http://www.lavrsen.dk/foswiki/bin/view/Motion/FeatureRequest2010x04x14x082244 (Angel Carpintero) * Added new log type COR , to filter messages from CORE. (Angel Carpintero) * Added a new starting option -m to disable motion detection. (Angel Carpintero) + * Allow image dimension not 4:3 changing a check of modulo 16 by modulo 8. (Jeroen Massar) Bugfixes * Avoid segfault detecting strerror_r() version GNU or SUSv3. (Angel Carpintero) @@ -73,6 +74,8 @@ Bugfixes * Fixed motion.conf-dist , adding text according with config options. * Fixed a bug in post_capture. It was missed under certain conditions. * Fixed configure for SDL. + * Replace malloc() by calloc(). (Jeroen Massar) + * Free file descriptor buffers on exit. 3.2.12 Summary of Changes diff --git a/conf.c b/conf.c index 901bc93..2581c80 100644 --- a/conf.c +++ b/conf.c @@ -159,7 +159,6 @@ struct config conf_template = { log_file: NULL, log_level: LEVEL_DEFAULT+10, log_type_str: NULL, -// motion_detection_pause: 1, }; diff --git a/conf.h b/conf.h index cad2eef..b03397e 100644 --- a/conf.h +++ b/conf.h @@ -133,7 +133,6 @@ struct config { int minimum_motion_frames; const char *exif_text; char *pid_file; -// unsigned int motion_detection_pause; int argc; char **argv; }; diff --git a/configure b/configure index 7dd38f5..5b96e29 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for motion Git-2efcf1bb6170c04862519af700be5f23e77128ec. +# Generated by GNU Autoconf 2.67 for motion Git-05b815771a359a3a66c1c06a597cb6b947fefe89. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -549,8 +549,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='motion' PACKAGE_TARNAME='motion' -PACKAGE_VERSION='Git-2efcf1bb6170c04862519af700be5f23e77128ec' -PACKAGE_STRING='motion Git-2efcf1bb6170c04862519af700be5f23e77128ec' +PACKAGE_VERSION='Git-05b815771a359a3a66c1c06a597cb6b947fefe89' +PACKAGE_STRING='motion Git-05b815771a359a3a66c1c06a597cb6b947fefe89' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1217,7 +1217,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures motion Git-2efcf1bb6170c04862519af700be5f23e77128ec to adapt to many kinds of systems. +\`configure' configures motion Git-05b815771a359a3a66c1c06a597cb6b947fefe89 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1278,7 +1278,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of motion Git-2efcf1bb6170c04862519af700be5f23e77128ec:";; + short | recursive ) echo "Configuration of motion Git-05b815771a359a3a66c1c06a597cb6b947fefe89:";; esac cat <<\_ACEOF @@ -1424,7 +1424,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -motion configure Git-2efcf1bb6170c04862519af700be5f23e77128ec +motion configure Git-05b815771a359a3a66c1c06a597cb6b947fefe89 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2021,7 +2021,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by motion $as_me Git-2efcf1bb6170c04862519af700be5f23e77128ec, which was +It was created by motion $as_me Git-05b815771a359a3a66c1c06a597cb6b947fefe89, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -6531,7 +6531,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by motion $as_me Git-2efcf1bb6170c04862519af700be5f23e77128ec, which was +This file was extended by motion $as_me Git-05b815771a359a3a66c1c06a597cb6b947fefe89, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6593,7 +6593,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -motion config.status Git-2efcf1bb6170c04862519af700be5f23e77128ec +motion config.status Git-05b815771a359a3a66c1c06a597cb6b947fefe89 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/motion.c b/motion.c index 64426d5..5666770 100644 --- a/motion.c +++ b/motion.c @@ -389,8 +389,8 @@ static void motion_remove_pid(void) if (ptr_logfile) { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Closing logfile (%s).", cnt_list[0]->conf.log_file); - set_log_mode(LOGMODE_SYSLOG); myfclose(ptr_logfile); + set_log_mode(LOGMODE_SYSLOG); ptr_logfile = NULL; } @@ -3085,13 +3085,13 @@ int myfclose(FILE* fh) for (i = 0; i < MYBUFCOUNT; i++) { if (buffers[i].fh == fh) { buffers[i].fh = NULL; -#if 0 /* Don't free the buffers for now, reuse them instead */ - if (buffers[i].buffer) - free(buffers[i].buffer); + if ( finish ) { + /* Free the buffers */ + if (buffers[i].buffer) + free(buffers[i].buffer); buffers[i].buffer = NULL; buffers[i].bufsize = 0; -#endif - break; + } } } return rval; diff --git a/video_common.c b/video_common.c index 4acb452..9f8d6a0 100644 --- a/video_common.c +++ b/video_common.c @@ -644,7 +644,7 @@ void vid_close(struct context *cnt) * Returns * device number * -1 if failed to open device. - * -3 image dimensions are not modulo 16 + * -3 image dimensions are not modulo 8 */ static int vid_v4lx_start(struct context *cnt) { @@ -659,17 +659,17 @@ static int vid_v4lx_start(struct context *cnt) * We use width and height from conf in this function. They will be assigned * to width and height in imgs here, and cap_width and cap_height in * rotate_data won't be set until in rotate_init. - * Motion requires that width and height is a multiple of 16 so we check + * Motion requires that width and height is a multiple of 8 so we check * for this first. */ - if (conf->width % 16) { - MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, "%s: config image width (%d) is not modulo 16", + if (conf->width % 8) { + MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, "%s: config image width (%d) is not modulo 8", conf->width); return -3; } - if (conf->height % 16) { - MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, "%s: config image height (%d) is not modulo 16", + if (conf->height % 8) { + MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, "%s: config image height (%d) is not modulo 8", conf->height); return -3; } @@ -837,7 +837,7 @@ static int vid_v4lx_start(struct context *cnt) * vid_start setup the capture device. This will be either a V4L device or a netcam. * The function does the following: * - If the camera is a netcam - netcam_start is called and function returns - * - Width and height are checked for valid value (multiple of 16) + * - Width and height are checked for valid value (multiple of 8) * - Copy the config height and width to the imgs struct. Note that height and width are * only copied to the from the conf struct to the imgs struct during program startup * The width and height can no later be changed via http remote control as this would @@ -851,7 +851,7 @@ static int vid_v4lx_start(struct context *cnt) * Returns * device number * -1 if failed to open device. - * -3 image dimensions are not modulo 16 + * -3 image dimensions are not modulo 8 */ int vid_start(struct context *cnt) { diff --git a/video_freebsd.c b/video_freebsd.c index 559229e..ec98a55 100644 --- a/video_freebsd.c +++ b/video_freebsd.c @@ -1080,18 +1080,18 @@ int vid_start(struct context *cnt) * We use width and height from conf in this function. They will be assigned * to width and height in imgs here, and cap_width and cap_height in * rotate_data won't be set until in rotate_init. - * Motion requires that width and height are multiples of 16 so we check for this. + * Motion requires that width and height are multiples of 8 so we check for this. */ - if (conf->width % 16) { + if (conf->width % 8) { MOTION_LOG(CRT, TYPE_VIDEO, NO_ERRNO, - "%s: config image width (%d) is not modulo 16", + "%s: config image width (%d) is not modulo 8", conf->width); return -1; } - if (conf->height % 16) { + if (conf->height % 8) { MOTION_LOG(CRT, TYPE_VIDEO, NO_ERRNO, - "%s: config image height (%d) is not modulo 16", + "%s: config image height (%d) is not modulo 8", conf->height); return -1; }