From 734155f35880856e5076559f8dbb4e17aa5d6107 Mon Sep 17 00:00:00 2001 From: Angel Carpintero Date: Sat, 22 Oct 2011 18:59:01 +0200 Subject: [PATCH] Fix http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2011x10x05x071936 Improve Git hash for configure.in --- CHANGELOG | 4 +++- CREDITS | 2 ++ config.h.in | 6 ++++++ configure | 34 +++++++++++++++++++++++++--------- configure.in | 4 ++++ ffmpeg.c | 7 +++++++ git-commit-version.sh | 2 +- 7 files changed, 48 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5d55c67..533c7c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -40,7 +40,7 @@ Features * Added a macro MOTION_LOG , no need to add __FUNCTION__ anymore. (Angel Carpintero) * Added EXIF feature for jpeg images , http://www.lavrsen.dk/foswiki/bin/view/Motion/ExifTaggingPatch (Wim Lewis) * Improve detection of av_register_protocol() for ffmpeg (Angel Carpintero). - + Bugfixes * Avoid segfault detecting strerror_r() version GNU or SUSv3. (Angel Carpintero) @@ -61,6 +61,8 @@ Bugfixes * No PQfinish() (Angel Carpintero) * Input for webcams has to be set to -1 http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2011x01x21x162309 + * Added a conditional check for avformat_alloc_context , av_avformat_alloc_context to fix + http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2011x10x05x071936 (Angel Carpintero) 3.2.12 Summary of Changes diff --git a/CREDITS b/CREDITS index b52ecde..e4663e2 100644 --- a/CREDITS +++ b/CREDITS @@ -430,6 +430,8 @@ Angel Carpintero * Fixed FFV1 codec encode with ffmpeg. http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2010x04x13x032553 * No PQfinish(). + * Added a conditional check for avformat_alloc_context , av_avformat_alloc_context to fix + http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2011x10x05x071936 Jared D * Change bayer2rgb24() to fix a problem with sn9c102 driver diff --git a/config.h.in b/config.h.in index 9e10ae3..406c68f 100644 --- a/config.h.in +++ b/config.h.in @@ -81,6 +81,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -107,3 +110,6 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const + +/* Define to 1 if you have avformat_alloc_context support */ +#undef have_avformat_alloc_context diff --git a/configure b/configure index 8150638..470f814 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-5bd495e48fd148bf73befc5763f8d29c5b2558ee. +# Generated by GNU Autoconf 2.67 for motion Git-58627b05aad3f978a97b36ac05f9917015030602. # # # 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-5bd495e48fd148bf73befc5763f8d29c5b2558ee' -PACKAGE_STRING='motion Git-5bd495e48fd148bf73befc5763f8d29c5b2558ee' +PACKAGE_VERSION='Git-58627b05aad3f978a97b36ac05f9917015030602' +PACKAGE_STRING='motion Git-58627b05aad3f978a97b36ac05f9917015030602' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1216,7 +1216,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-5bd495e48fd148bf73befc5763f8d29c5b2558ee to adapt to many kinds of systems. +\`configure' configures motion Git-58627b05aad3f978a97b36ac05f9917015030602 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1277,7 +1277,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of motion Git-5bd495e48fd148bf73befc5763f8d29c5b2558ee:";; + short | recursive ) echo "Configuration of motion Git-58627b05aad3f978a97b36ac05f9917015030602:";; esac cat <<\_ACEOF @@ -1419,7 +1419,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -motion configure Git-5bd495e48fd148bf73befc5763f8d29c5b2558ee +motion configure Git-58627b05aad3f978a97b36ac05f9917015030602 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2016,7 +2016,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-5bd495e48fd148bf73befc5763f8d29c5b2558ee, which was +It was created by motion $as_me Git-58627b05aad3f978a97b36ac05f9917015030602, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -5373,6 +5373,22 @@ CFLAGS="${TEMP_CFLAGS} $UNAME_DEFS $CPU_OPTIONS" LIBS="${TEMP_LIBS}" LDFLAGS="${TEMP_LDFLAGS}" + +ac_fn_c_check_func "$LINENO" "avformat_alloc_context" "ac_cv_func_avformat_alloc_context" +if test "x$ac_cv_func_avformat_alloc_context" = x""yes; then : + +$as_echo "#define have_avformat_alloc_context 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "av_avformat_alloc_context" "ac_cv_func_av_avformat_alloc_context" +if test "x$ac_cv_func_av_avformat_alloc_context" = x""yes; then : + +$as_echo "#define have_av_avformat_alloc_context 1" >>confdefs.h + +fi + + # # Add the right exec path for rc scripts # @@ -5902,7 +5918,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-5bd495e48fd148bf73befc5763f8d29c5b2558ee, which was +This file was extended by motion $as_me Git-58627b05aad3f978a97b36ac05f9917015030602, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5964,7 +5980,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-5bd495e48fd148bf73befc5763f8d29c5b2558ee +motion config.status Git-58627b05aad3f978a97b36ac05f9917015030602 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index eb41f9c..b4f140b 100644 --- a/configure.in +++ b/configure.in @@ -1169,6 +1169,10 @@ CFLAGS="${TEMP_CFLAGS} $UNAME_DEFS $CPU_OPTIONS" LIBS="${TEMP_LIBS}" LDFLAGS="${TEMP_LDFLAGS}" + +AC_CHECK_FUNC(avformat_alloc_context, AC_DEFINE([have_avformat_alloc_context],1,[Define to 1 if you have avformat_alloc_context support])) +AC_CHECK_FUNC(av_avformat_alloc_context, AC_DEFINE([have_av_avformat_alloc_context],1,[Define to 1 if you have av_avformat_alloc_context support])) + # # Add the right exec path for rc scripts # diff --git a/ffmpeg.c b/ffmpeg.c index 0380a54..3a7ac67 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -434,7 +434,14 @@ struct ffmpeg *ffmpeg_open(char *ffmpeg_video_codec, char *filename, snprintf(ffmpeg->codec, sizeof(ffmpeg->codec), "%s", ffmpeg_video_codec); /* Allocation the output media context. */ +#ifdef have_avformat_alloc_context + ffmpeg->oc = avformat_alloc_context(); +#elif defined have_av_avformat_alloc_context + ffmpeg->oc = av_alloc_format_context(); +#else ffmpeg->oc = av_mallocz(sizeof(AVFormatContext)); +#endif + if (!ffmpeg->oc) { MOTION_LOG(ERR, TYPE_ENCODER, SHOW_ERRNO, "%s: Memory error while allocating" " output media context"); diff --git a/git-commit-version.sh b/git-commit-version.sh index f36b6db..2a47df1 100755 --- a/git-commit-version.sh +++ b/git-commit-version.sh @@ -1,5 +1,5 @@ #!/bin/sh -SNV_VERSION=`git show | grep commit|cut -d' ' -f2` +SNV_VERSION=`git show -s --format=%H` echo -n "Git-$SNV_VERSION"