[SCM] transcode/master: Imported Upstream version 1.1.5

mira-guest at users.alioth.debian.org mira-guest at users.alioth.debian.org
Tue Feb 7 17:25:45 UTC 2012


The following commit has been merged in the master branch:
commit 494c6547a0ebb6d60ad71722d8dfdf13a59e469a
Author: Jaromír Mikeš <mira.mikes at seznam.cz>
Date:   Tue Feb 7 16:41:05 2012 +0100

    Imported Upstream version 1.1.5

diff --git a/ChangeLog b/ChangeLog
index ea96961..d98b50f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,28 @@
 Key:
 [+] feature added
 [!] bugfix of an existing feature
-[*] changement/improvement (not bugfix) of an existing feature
+[*] change/improvement (not bugfix) of an existing feature
 [-] feature dropped
 
 ===========================================================================
+transcode-1.1.5
+---------------
+[*] Add a special-crafted import module targeting webcams using libv4l.
+[+] Fixed the colorspace detection into import_v4l2.
+[*] tcdemux: drop the builtin limit of streams selectable for passthrough.
+[*] Fixed the x264 module to work with libx264 >= 76.
+[*] Update the video stabilization plugins to version 0.61.
+[*] Made libmpeg2 an optional dependency (libmpeg2convert is needed too).
+===========================================================================
+
+===========================================================================
+transcode-1.1.4
+---------------
+[!] Fixed the build system to comply with autoconf 2.64.
+[!] Fixed bugs: #16046
+===========================================================================
+
+===========================================================================
 transcode-1.1.3
 ---------------
 [+] Support for CubicKeys4 and Sinc8 zoom algorithms.
diff --git a/INSTALL b/INSTALL
index 7392f5f..1e9c43f 100644
--- a/INSTALL
+++ b/INSTALL
@@ -133,16 +133,6 @@ Mandatory packages:
       --with-libavformat-libs=DIR (/usr/lib)
           prefix where libavformat libraries [libavformat.so] are installed
 
-  libmpeg2 from mpeg2dec >= 0.4.0b  http://libmpeg2.sourceforge.net/
-  libmpeg2convert is needed as well (shipped in the same package of libmpeg2)
-    related options:
-      --with-libmpeg2-prefix=PFX (/usr)
-          prefix where libmpeg2 is installed
-      --with-libmpeg2-includes=DIR (/usr/include)
-          directory where libmpeg2 headers [mpeg2dec/mpeg2.h] are installed
-      --with-libmpeg2-libs=DIR (/usr/lib)
-          prefix where libmpeg2 libraries [libmpeg2.so] are installed
-
 OS dependent packages:
 
   v4l
@@ -176,7 +166,6 @@ OS dependent packages:
     affected modules: import_sunau.so
 
 Optional packages:
-
   libpostproc (part of FFmpeg) http://ffmpeg.mplayerhq.hu/
     related options:
       --enable-libpostproc (disabled)
@@ -204,6 +193,16 @@ Optional packages:
           directory where FreeType libraries [libfreetype.so] are installed
     affected modules: filter_text.so, filter_subtitler.so
 
+  libmpeg2 from mpeg2dec >= 0.4.0b  http://libmpeg2.sourceforge.net/
+  libmpeg2convert is needed as well (shipped in the same package of libmpeg2)
+    related options:
+      --with-libmpeg2-prefix=PFX (/usr)
+          prefix where libmpeg2 is installed
+      --with-libmpeg2-includes=DIR (/usr/include)
+          directory where libmpeg2 headers [mpeg2dec/mpeg2.h] are installed
+      --with-libmpeg2-libs=DIR (/usr/lib)
+          prefix where libmpeg2 libraries [libmpeg2.so] are installed
+
   liba52  http://liba52.sourceforge.net/
     related options:
       --enable-a52 (disabled)
diff --git a/Makefile.in b/Makefile.in
index 516154d..e3b57b0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -155,6 +155,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -167,6 +169,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -248,7 +254,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -264,22 +269,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -287,7 +285,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -296,11 +293,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/acinclude.m4 b/acinclude.m4
index de70254..f6c5e87 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -642,6 +642,53 @@ fi
 ])
 
 dnl -----------------------------------------------------------------------
+dnl -----------------------------------------------------------------------
+
+dnl TC_PKG_CONFIG_CHECK(name, req-enable, var-name, pkgconfig-name, url)
+dnl Test for pkg-name, and define var-name_CFLAGS and var-name_LIBS
+dnl   and HAVE_var-name if found; like TC_PKG_CHECK, but using pkg-config
+dnl
+dnl 1 name          name of package; required (used in messages, option names)
+dnl 2 req-enable    enable by default, 'required', 'optional', 'yes' or 'no'; required
+dnl 3 var-name      name stub for variables, preferably uppercase; required
+dnl 4 pkg           pkg-config name
+dnl 5 url           homepage for the package
+
+AC_DEFUN([TC_PKG_CONFIG_CHECK],
+[
+if test x"$2" = x"required" -o x"$2" = x"optional" ; then
+  enable_$1="yes"
+else
+  AC_MSG_CHECKING([whether $1 support is requested])
+  AC_ARG_ENABLE($1,
+    AC_HELP_STRING([--enable-$1],
+      [build with $1 support ($2)]),
+    [case "${enableval}" in
+      yes) ;;
+      no)  ;;
+      *) AC_MSG_ERROR(bad value ${enableval} for --enable-$1) ;;
+    esac],
+    enable_$1="$2")
+  AC_MSG_RESULT($enable_$1)
+fi
+
+have_$1="no"
+this_pkg_err="no"
+
+if test x"$enable_$1" = x"yes" ; then
+   PKG_CHECK_MODULES($3, $4,
+       [have_$1="yes"],
+       [TC_PKG_ERROR($1, $4, $3, $4, $5)])
+else
+  $3_CFLAGS=""
+  $3_LIBS=""
+fi
+])
+
+
+
+dnl -----------------------------------------------------------------------
+dnl -----------------------------------------------------------------------
 
 dnl TC_PKG_ERROR(name, object, req-enable, pkg, url, [error message])
 dnl
diff --git a/aclib/Makefile.in b/aclib/Makefile.in
index 43c13a2..16ec47b 100644
--- a/aclib/Makefile.in
+++ b/aclib/Makefile.in
@@ -135,6 +135,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -147,6 +149,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -228,7 +234,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -244,22 +249,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -267,7 +265,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -276,11 +273,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/aclocal.m4 b/aclocal.m4
index 58e8f83..266eac0 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -6671,6 +6671,164 @@ AC_SUBST([SED])
 AC_MSG_RESULT([$SED])
 ])
 
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+		
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+    if test -n "$$1"; then
+        pkg_cv_[]$1="$$1"
+    else
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+			 [pkg_failed=yes])
+    fi
+else
+	pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
 # Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
diff --git a/avilib/Makefile.in b/avilib/Makefile.in
index a91a4cf..2deb8b5 100644
--- a/avilib/Makefile.in
+++ b/avilib/Makefile.in
@@ -143,6 +143,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -155,6 +157,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -236,7 +242,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -252,22 +257,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -275,7 +273,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -284,11 +281,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/config.h.in b/config.h.in
index 7b61f0f..e83a533 100644
--- a/config.h.in
+++ b/config.h.in
@@ -150,12 +150,21 @@
 /* have libmpeg2 support */
 #undef HAVE_LIBMPEG2
 
+/* have libmpeg2convert support */
+#undef HAVE_LIBMPEG2CONVERT
+
 /* have libpostproc support */
 #undef HAVE_LIBPOSTPROC
 
 /* have libquicktime support */
 #undef HAVE_LIBQUICKTIME
 
+/* have libv4l2 support */
+#undef HAVE_LIBV4L2
+
+/* have libv4lconvert support */
+#undef HAVE_LIBV4LCONVERT
+
 /* have libxml2 support */
 #undef HAVE_LIBXML2
 
diff --git a/configure b/configure
index 167b2ec..155a222 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.61 for transcode 1.1.3.
+# Generated by GNU Autoconf 2.61 for transcode 1.1.5.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='transcode'
 PACKAGE_TARNAME='transcode'
-PACKAGE_VERSION='1.1.3'
-PACKAGE_STRING='transcode 1.1.3'
+PACKAGE_VERSION='1.1.5'
+PACKAGE_STRING='transcode 1.1.5'
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="src/transcode.c"
@@ -951,11 +951,22 @@ LIBAVFORMAT_CFLAGS
 LIBAVFORMAT_LIBS
 HAVE_FFMPEG_TRUE
 HAVE_FFMPEG_FALSE
-libmpeg2_config
-HAVE_LIBMPEG2_TRUE
-HAVE_LIBMPEG2_FALSE
+LIBV4L2_CFLAGS
+LIBV4L2_LIBS
+LIBV4LCONVERT_CFLAGS
+LIBV4LCONVERT_LIBS
+HAVE_LIBV4L2_TRUE
+HAVE_LIBV4L2_FALSE
+HAVE_LIBV4LCONVERT_TRUE
+HAVE_LIBV4LCONVERT_FALSE
 LIBMPEG2_CFLAGS
 LIBMPEG2_LIBS
+LIBMPEG2CONVERT_CFLAGS
+LIBMPEG2CONVERT_LIBS
+HAVE_LIBMPEG2_TRUE
+HAVE_LIBMPEG2_FALSE
+HAVE_LIBMPEG2CONVERT_TRUE
+HAVE_LIBMPEG2CONVERT_FALSE
 ENABLE_EXPERIMENTAL_TRUE
 ENABLE_EXPERIMENTAL_FALSE
 ENABLE_DEPRECATED_TRUE
@@ -970,16 +981,14 @@ HAVE_OSS_TRUE
 HAVE_OSS_FALSE
 HAVE_ALSA_TRUE
 HAVE_ALSA_FALSE
-libpostproc_config
-HAVE_LIBPOSTPROC_TRUE
-HAVE_LIBPOSTPROC_FALSE
 LIBPOSTPROC_CFLAGS
 LIBPOSTPROC_LIBS
-freetype2_config
-HAVE_FREETYPE2_TRUE
-HAVE_FREETYPE2_FALSE
+HAVE_LIBPOSTPROC_TRUE
+HAVE_LIBPOSTPROC_FALSE
 FREETYPE2_CFLAGS
 FREETYPE2_LIBS
+HAVE_FREETYPE2_TRUE
+HAVE_FREETYPE2_FALSE
 lame_config
 HAVE_LAME_TRUE
 HAVE_LAME_FALSE
@@ -990,26 +999,22 @@ HAVE_XVID_TRUE
 HAVE_XVID_FALSE
 XVID_CFLAGS
 XVID_LIBS
-x264_config
-HAVE_X264_TRUE
-HAVE_X264_FALSE
 X264_CFLAGS
 X264_LIBS
-ogg_config
-HAVE_OGG_TRUE
-HAVE_OGG_FALSE
+HAVE_X264_TRUE
+HAVE_X264_FALSE
 OGG_CFLAGS
 OGG_LIBS
-vorbis_config
-HAVE_VORBIS_TRUE
-HAVE_VORBIS_FALSE
+HAVE_OGG_TRUE
+HAVE_OGG_FALSE
 VORBIS_CFLAGS
 VORBIS_LIBS
-theora_config
-HAVE_THEORA_TRUE
-HAVE_THEORA_FALSE
+HAVE_VORBIS_TRUE
+HAVE_VORBIS_FALSE
 THEORA_CFLAGS
 THEORA_LIBS
+HAVE_THEORA_TRUE
+HAVE_THEORA_FALSE
 libdvdread_config
 HAVE_LIBDVDREAD_TRUE
 HAVE_LIBDVDREAD_FALSE
@@ -1021,16 +1026,14 @@ HAVE_PVM3_TRUE
 HAVE_PVM3_FALSE
 PVM3_CFLAGS
 PVM3_LIBS
-libdv_config
-HAVE_LIBDV_TRUE
-HAVE_LIBDV_FALSE
 LIBDV_CFLAGS
 LIBDV_LIBS
-libquicktime_config
-HAVE_LIBQUICKTIME_TRUE
-HAVE_LIBQUICKTIME_FALSE
+HAVE_LIBDV_TRUE
+HAVE_LIBDV_FALSE
 LIBQUICKTIME_CFLAGS
 LIBQUICKTIME_LIBS
+HAVE_LIBQUICKTIME_TRUE
+HAVE_LIBQUICKTIME_FALSE
 lzo_config
 HAVE_LZO_TRUE
 HAVE_LZO_FALSE
@@ -1046,26 +1049,23 @@ HAVE_FAAC_TRUE
 HAVE_FAAC_FALSE
 FAAC_CFLAGS
 FAAC_LIBS
-libxml2_config
-HAVE_LIBXML2_TRUE
-HAVE_LIBXML2_FALSE
 LIBXML2_CFLAGS
 LIBXML2_LIBS
+HAVE_LIBXML2_TRUE
+HAVE_LIBXML2_FALSE
 IBP_LIBS
 HAVE_IBP_TRUE
 HAVE_IBP_FALSE
 XIO_CFLAGS
 XIO_LIBS
-mjpegtools_config
-HAVE_MJPEGTOOLS_TRUE
-HAVE_MJPEGTOOLS_FALSE
 MJPEGTOOLS_CFLAGS
 MJPEGTOOLS_LIBS
-sdl_config
-HAVE_SDL_TRUE
-HAVE_SDL_FALSE
+HAVE_MJPEGTOOLS_TRUE
+HAVE_MJPEGTOOLS_FALSE
 SDL_CFLAGS
 SDL_LIBS
+HAVE_SDL_TRUE
+HAVE_SDL_FALSE
 imagemagick_config
 HAVE_IMAGEMAGICK_TRUE
 HAVE_IMAGEMAGICK_FALSE
@@ -1113,7 +1113,38 @@ CPP
 CCAS
 CCASFLAGS
 CXXCPP
-XMKMF'
+PKG_CONFIG
+XMKMF
+LIBV4L2_CFLAGS
+LIBV4L2_LIBS
+LIBV4LCONVERT_CFLAGS
+LIBV4LCONVERT_LIBS
+LIBMPEG2_CFLAGS
+LIBMPEG2_LIBS
+LIBMPEG2CONVERT_CFLAGS
+LIBMPEG2CONVERT_LIBS
+LIBPOSTPROC_CFLAGS
+LIBPOSTPROC_LIBS
+FREETYPE2_CFLAGS
+FREETYPE2_LIBS
+X264_CFLAGS
+X264_LIBS
+OGG_CFLAGS
+OGG_LIBS
+VORBIS_CFLAGS
+VORBIS_LIBS
+THEORA_CFLAGS
+THEORA_LIBS
+LIBDV_CFLAGS
+LIBDV_LIBS
+LIBQUICKTIME_CFLAGS
+LIBQUICKTIME_LIBS
+LIBXML2_CFLAGS
+LIBXML2_LIBS
+MJPEGTOOLS_CFLAGS
+MJPEGTOOLS_LIBS
+SDL_CFLAGS
+SDL_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1616,7 +1647,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 transcode 1.1.3 to adapt to many kinds of systems.
+\`configure' configures transcode 1.1.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1691,7 +1722,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of transcode 1.1.3:";;
+     short | recursive ) echo "Configuration of transcode 1.1.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1717,8 +1748,11 @@ Optional Features:
                           (yes)
   --enable-libavcodec     build with libavcodec support (optional)
   --enable-libavformat    build with libavformat support (optional)
-  --enable-libavformat    build with libavformat support (required)
-  --enable-libmpeg2       build with libmpeg2 support (required)
+  --enable-libv4l2        build with libv4l2 support (no)
+  --enable-libv4lconvert  build with libv4lconvert support (no)
+  --enable-libmpeg2       build with libmpeg2 support (no)
+  --enable-libmpeg2convert
+                          build with libmpeg2convert support (no)
   --enable-experimental   enable new, experimental or even incomplete
                           transcode components (no)
   --enable-deprecated     enable deprecated or even broken transcode
@@ -1786,34 +1820,6 @@ Optional Packages:
   --with-libavformat-libs=DIR
                           directory where libavformat libraries
                           (libavformat.so) are installed (/usr/lib)
-  --with-libavformat-includes=DIR
-                          directory where libavformat headers
-                          (ffmpeg/avformat.h) are installed (/usr/include)
-  --with-libmpeg2-prefix=PFX
-                          prefix where libmpeg2 is installed (/usr)
-  --with-libmpeg2-includes=DIR
-                          directory where libmpeg2 headers (mpeg2dec/mpeg2.h)
-                          are installed (/usr/include)
-  --with-libmpeg2-libs=DIR
-                          directory where libmpeg2 libraries (libmpeg2.so) are
-                          installed (/usr/lib)
-  --with-libpostproc-prefix=PFX
-                          prefix where libpostproc is installed (/usr)
-  --with-libpostproc-includes=DIR
-                          directory where libpostproc headers
-                          (libpostproc/postprocess.h) are installed
-                          (/usr/include)
-  --with-libpostproc-libs=DIR
-                          directory where libpostproc libraries
-                          (libpostproc.so) are installed (/usr/lib)
-  --with-freetype2-prefix=PFX
-                          prefix where freetype2 is installed (/usr)
-  --with-freetype2-includes=DIR
-                          directory where freetype2 headers (ft2build.h) are
-                          installed (/usr/include)
-  --with-freetype2-libs=DIR
-                          directory where freetype2 libraries (libfreetype.so)
-                          are installed (/usr/lib)
   --with-lame-prefix=PFX  prefix where lame is installed (/usr)
   --with-lame-includes=DIR
                           directory where lame headers (none) are installed
@@ -1826,31 +1832,6 @@ Optional Packages:
                           (/usr/include)
   --with-xvid-libs=DIR    directory where xvid libraries (libxvidcore.so) are
                           installed (/usr/lib)
-  --with-x264-prefix=PFX  prefix where x264 is installed (/usr)
-  --with-x264-includes=DIR
-                          directory where x264 headers (x264.h) are installed
-                          (/usr/include)
-  --with-x264-libs=DIR    directory where x264 libraries (libx264.so) are
-                          installed (/usr/lib)
-  --with-ogg-prefix=PFX   prefix where ogg is installed (/usr)
-  --with-ogg-includes=DIR directory where ogg headers (ogg/ogg.h) are
-                          installed (/usr/include)
-  --with-ogg-libs=DIR     directory where ogg libraries (libogg.so) are
-                          installed (/usr/lib)
-  --with-vorbis-prefix=PFX
-                          prefix where vorbis is installed (/usr)
-  --with-vorbis-includes=DIR
-                          directory where vorbis headers (vorbis/codec.h) are
-                          installed (/usr/include)
-  --with-vorbis-libs=DIR  directory where vorbis libraries (libvorbis.so) are
-                          installed (/usr/lib)
-  --with-theora-prefix=PFX
-                          prefix where theora is installed (/usr)
-  --with-theora-includes=DIR
-                          directory where theora headers (theora/theora.h) are
-                          installed (/usr/include)
-  --with-theora-libs=DIR  directory where theora libraries (libtheora.so) are
-                          installed (/usr/lib)
   --with-libdvdread-prefix=PFX
                           prefix where libdvdread is installed (/usr)
   --with-libdvdread-includes=DIR
@@ -1865,20 +1846,6 @@ Optional Packages:
                           (/usr/include)
   --with-pvm3-libs=DIR    directory where pvm3 libraries (libpvm3.so) are
                           installed (/usr/lib)
-  --with-libdv-prefix=PFX prefix where libdv is installed (/usr)
-  --with-libdv-includes=DIR
-                          directory where libdv headers (libdv/dv.h) are
-                          installed (/usr/include)
-  --with-libdv-libs=DIR   directory where libdv libraries (libdv.so) are
-                          installed (/usr/lib)
-  --with-libquicktime-prefix=PFX
-                          prefix where libquicktime is installed (/usr)
-  --with-libquicktime-includes=DIR
-                          directory where libquicktime headers (quicktime.h)
-                          are installed (/usr/include)
-  --with-libquicktime-libs=DIR
-                          directory where libquicktime libraries
-                          (libquicktime.so) are installed (/usr/lib)
   --with-lzo-prefix=PFX   prefix where lzo is installed (/usr)
   --with-lzo-includes=DIR directory where lzo headers (lzo/lzo1x.h) are
                           installed (/usr/include)
@@ -1895,32 +1862,12 @@ Optional Packages:
                           (/usr/include)
   --with-faac-libs=DIR    directory where faac libraries (libfaac.so) are
                           installed (/usr/lib)
-  --with-libxml2-prefix=PFX
-                          prefix where libxml2 is installed (/usr)
-  --with-libxml2-includes=DIR
-                          directory where libxml2 headers (libxml/parser.h)
-                          are installed (/usr/include)
-  --with-libxml2-libs=DIR directory where libxml2 libraries (libxml2.so) are
-                          installed (/usr/lib)
   --with-libfdr=DIR       base directory for libfdr
   --with-libibp=DIR       base directory for libibp
   --with-libexnode=DIR    base directory for libexnode
   --with-liblbone=DIR     base directory for liblbone
   --with-libend2end=DIR   base directory for libend2end
   --with-liblors=DIR      base directory for liblors
-  --with-mjpegtools-prefix=PFX
-                          prefix where mjpegtools is installed (/usr)
-  --with-mjpegtools-includes=DIR
-                          directory where mjpegtools headers
-                          (mjpegtools/yuv4mpeg.h) are installed (/usr/include)
-  --with-mjpegtools-libs=DIR
-                          directory where mjpegtools libraries
-                          (libmjpegutils.so) are installed (/usr/lib)
-  --with-sdl-prefix=PFX   prefix where sdl is installed (/usr)
-  --with-sdl-includes=DIR directory where sdl headers (SDL.h) are installed
-                          (/usr/include)
-  --with-sdl-libs=DIR     directory where sdl libraries (libSDL.so) are
-                          installed (/usr/lib)
   --with-imagemagick-prefix=PFX
                           prefix where imagemagick is installed (/usr)
   --with-imagemagick-includes=DIR
@@ -1973,7 +1920,59 @@ Some influential environment variables:
   CCAS        assembler compiler command (defaults to CC)
   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
   CXXCPP      C++ preprocessor
+  PKG_CONFIG  path to pkg-config utility
   XMKMF       Path to xmkmf, Makefile generator for X Window System
+  LIBV4L2_CFLAGS
+              C compiler flags for LIBV4L2, overriding pkg-config
+  LIBV4L2_LIBS
+              linker flags for LIBV4L2, overriding pkg-config
+  LIBV4LCONVERT_CFLAGS
+              C compiler flags for LIBV4LCONVERT, overriding pkg-config
+  LIBV4LCONVERT_LIBS
+              linker flags for LIBV4LCONVERT, overriding pkg-config
+  LIBMPEG2_CFLAGS
+              C compiler flags for LIBMPEG2, overriding pkg-config
+  LIBMPEG2_LIBS
+              linker flags for LIBMPEG2, overriding pkg-config
+  LIBMPEG2CONVERT_CFLAGS
+              C compiler flags for LIBMPEG2CONVERT, overriding pkg-config
+  LIBMPEG2CONVERT_LIBS
+              linker flags for LIBMPEG2CONVERT, overriding pkg-config
+  LIBPOSTPROC_CFLAGS
+              C compiler flags for LIBPOSTPROC, overriding pkg-config
+  LIBPOSTPROC_LIBS
+              linker flags for LIBPOSTPROC, overriding pkg-config
+  FREETYPE2_CFLAGS
+              C compiler flags for FREETYPE2, overriding pkg-config
+  FREETYPE2_LIBS
+              linker flags for FREETYPE2, overriding pkg-config
+  X264_CFLAGS C compiler flags for X264, overriding pkg-config
+  X264_LIBS   linker flags for X264, overriding pkg-config
+  OGG_CFLAGS  C compiler flags for OGG, overriding pkg-config
+  OGG_LIBS    linker flags for OGG, overriding pkg-config
+  VORBIS_CFLAGS
+              C compiler flags for VORBIS, overriding pkg-config
+  VORBIS_LIBS linker flags for VORBIS, overriding pkg-config
+  THEORA_CFLAGS
+              C compiler flags for THEORA, overriding pkg-config
+  THEORA_LIBS linker flags for THEORA, overriding pkg-config
+  LIBDV_CFLAGS
+              C compiler flags for LIBDV, overriding pkg-config
+  LIBDV_LIBS  linker flags for LIBDV, overriding pkg-config
+  LIBQUICKTIME_CFLAGS
+              C compiler flags for LIBQUICKTIME, overriding pkg-config
+  LIBQUICKTIME_LIBS
+              linker flags for LIBQUICKTIME, overriding pkg-config
+  LIBXML2_CFLAGS
+              C compiler flags for LIBXML2, overriding pkg-config
+  LIBXML2_LIBS
+              linker flags for LIBXML2, overriding pkg-config
+  MJPEGTOOLS_CFLAGS
+              C compiler flags for MJPEGTOOLS, overriding pkg-config
+  MJPEGTOOLS_LIBS
+              linker flags for MJPEGTOOLS, overriding pkg-config
+  SDL_CFLAGS  C compiler flags for SDL, overriding pkg-config
+  SDL_LIBS    linker flags for SDL, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2038,7 +2037,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-transcode configure 1.1.3
+transcode configure 1.1.5
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -2052,7 +2051,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 transcode $as_me 1.1.3, which was
+It was created by transcode $as_me 1.1.5, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2871,7 +2870,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=transcode
- VERSION=1.1.3
+ VERSION=1.1.5
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5939,7 +5938,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5942 "configure"' > conftest.$ac_ext
+  echo '#line 5941 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7787,11 +7786,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7790: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7789: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7794: \$? = $ac_status" >&5
+   echo "$as_me:7793: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8077,11 +8076,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8080: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8079: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8084: \$? = $ac_status" >&5
+   echo "$as_me:8083: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8181,11 +8180,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8184: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8183: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8188: \$? = $ac_status" >&5
+   echo "$as_me:8187: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -10558,7 +10557,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10561 "configure"
+#line 10560 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10658,7 +10657,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10661 "configure"
+#line 10660 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13059,11 +13058,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13062: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13061: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13066: \$? = $ac_status" >&5
+   echo "$as_me:13065: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13163,11 +13162,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13166: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13165: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13170: \$? = $ac_status" >&5
+   echo "$as_me:13169: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14761,11 +14760,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14764: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14763: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14768: \$? = $ac_status" >&5
+   echo "$as_me:14767: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14865,11 +14864,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14868: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14867: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14872: \$? = $ac_status" >&5
+   echo "$as_me:14871: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17085,11 +17084,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17088: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17087: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17092: \$? = $ac_status" >&5
+   echo "$as_me:17091: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17375,11 +17374,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17378: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17377: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17382: \$? = $ac_status" >&5
+   echo "$as_me:17381: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17479,11 +17478,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17482: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17481: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:17486: \$? = $ac_status" >&5
+   echo "$as_me:17485: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -21424,15 +21423,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-sysconf(_SC_PAGESIZE)
+sysconf(_SC_PAGESIZE);
   ;
   return 0;
 }
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sysconf_with_sc_pagesize" >&5
-echo "${ECHO_T}$ac_cv_sysconf_with_sc_pagesize" >&6; }
-]
-_ACEOFrm -f conftest.$ac_objext
+_ACEOF
+rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -21449,15 +21445,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  :
+  ac_cv_sysconf_with_sc_pagesize=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+	ac_cv_sysconf_with_sc_pagesize=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sysconf_with_sc_pagesize" >&5
+echo "${ECHO_T}$ac_cv_sysconf_with_sc_pagesize" >&6; }
 if test x"$ac_cv_sysconf_with_sc_pagesize" = x"yes"; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -22768,6 +22767,126 @@ if test x"$ld_altivec" = x"yes" ; then
 fi
 
 
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.20
+	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	else
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+		PKG_CONFIG=""
+	fi
+
+fi
 if test -z "$PKG_CONFIG" ; then
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
@@ -24743,6 +24862,7 @@ echo "${ECHO_T}disabled" >&6; }
 else
   { echo "$as_me:$LINENO: result: requested" >&5
 echo "${ECHO_T}requested" >&6; }
+
         LIBAVCODEC_EXTRA_LIBS="$LIBAVCODEC_EXTRA_LIBS $($PKG_CONFIG --libs libavcodec)"
 
 if test x"optional" = x"required" -o x"optional" = x"optional" ; then
@@ -25309,8 +25429,7 @@ fi
 
 
 
-        ffmpeg_lavf_inc="ffmpeg"
-  LIBAVFORMAT_EXTRA_LIBS="$LIBAVFORMAT_EXTRA_LIBS $($PKG_CONFIG --libs libavformat)"
+        LIBAVFORMAT_EXTRA_LIBS="$LIBAVFORMAT_EXTRA_LIBS $($PKG_CONFIG --libs libavformat)"
 
 if test x"optional" = x"required" -o x"optional" = x"optional" ; then
   enable_libavformat="yes"
@@ -25782,303 +25901,70 @@ else
 fi
 
   if test x"$have_libavformat" = x"yes" ; then
-    ffmpeg_headers_layout="new"
-    ffmpeg_lavf_inc="libavformat"
-  else
-  # second try, old include path
-
-if test x"required" = x"required" -o x"required" = x"optional" ; then
-  enable_libavformat="yes"
-else
-  { echo "$as_me:$LINENO: checking whether libavformat support is requested" >&5
-echo $ECHO_N "checking whether libavformat support is requested... $ECHO_C" >&6; }
-  # Check whether --enable-libavformat was given.
-if test "${enable_libavformat+set}" = set; then
-  enableval=$enable_libavformat; case "${enableval}" in
-      yes) ;;
-      no)  ;;
-      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libavformat" >&5
-echo "$as_me: error: bad value ${enableval} for --enable-libavformat" >&2;}
-   { (exit 1); exit 1; }; } ;;
-    esac
-else
-  enable_libavformat="required"
-fi
-
-  { echo "$as_me:$LINENO: result: $enable_libavformat" >&5
-echo "${ECHO_T}$enable_libavformat" >&6; }
-fi
-
-
-# Check whether --with-libavformat-prefix was given.
-if test "${with_libavformat_prefix+set}" = set; then
-  withval=$with_libavformat_prefix; w_libavformat_p="$withval"
-else
-  w_libavformat_p=""
-fi
-
-
-
-# Check whether --with-libavformat-includes was given.
-if test "${with_libavformat_includes+set}" = set; then
-  withval=$with_libavformat_includes; w_libavformat_i="$withval"
-else
-  w_libavformat_i=""
-fi
-
-
-
-# Check whether --with-libavformat-libs was given.
-if test "${with_libavformat_libs+set}" = set; then
-  withval=$with_libavformat_libs; w_libavformat_l="$withval"
-else
-  w_libavformat_l=""
-fi
-
-
-have_libavformat="no"
-this_pkg_err="no"
-
-if test x"$enable_libavformat" = x"yes" ; then
-
-
-  pkg_config_libavformat="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libavformat" >&5
-echo $ECHO_N "checking for pkgconfig support for libavformat... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG libavformat --exists ; then
-      pkg_config_libavformat="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libavformat" >&5
-echo "${ECHO_T}$pkg_config_libavformat" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_libavformat_p" != x"" ; then
-      if test -x $w_libavformat_p/bin/no ; then
-        libavformat_config="$w_libavformat_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libavformat_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $libavformat_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_libavformat_config="$libavformat_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libavformat_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_libavformat_config" && ac_cv_path_libavformat_config="no"
-  ;;
-esac
-fi
-libavformat_config=$ac_cv_path_libavformat_config
-if test -n "$libavformat_config"; then
-  { echo "$as_me:$LINENO: result: $libavformat_config" >&5
-echo "${ECHO_T}$libavformat_config" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  else
-    libavformat_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBAVFORMAT_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBAVFORMAT_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libavformat_i" != x"" ; then
-    libavformat_ii="-I$w_libavformat_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libavformat" != x"no" ; then
-      libavformat_ii="`$PKG_CONFIG libavformat --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$libavformat_config" != x"no" ; then
-        libavformat_ii="`$libavformat_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libavformat_config" >&5
-echo "${ECHO_T}$libavformat_config" >&6; }
-      else
-        if test x"$w_libavformat_p" != x"" ; then
-          libavformat_ii="-I$w_libavformat_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libavformat_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $libavformat_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  libavformat_ii="$ipaths"
-  libavformat_ii="`echo $libavformat_ii | sed -e 's/  */ /g'`"
-  LIBAVFORMAT_EXTRA_CFLAGS="$LIBAVFORMAT_EXTRA_CFLAGS $xi"
-  LIBAVFORMAT_EXTRA_CFLAGS="`echo $LIBAVFORMAT_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"ffmpeg/avformat.h" != x"none" ; then
     save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libavformat_ii"
-    if test "${ac_cv_header_ffmpeg_avformat_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for ffmpeg/avformat.h" >&5
-echo $ECHO_N "checking for ffmpeg/avformat.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_ffmpeg_avformat_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_ffmpeg_avformat_h" >&5
-echo "${ECHO_T}$ac_cv_header_ffmpeg_avformat_h" >&6; }
+    CPPFLAGS="$CPPFLAGS $LIBAVFORMAT_CFLAGS"
+    if test "$cross_compiling" = yes; then
+  { echo "$as_me:$LINENO: result: cross compiling; assumed OK..." >&5
+echo "${ECHO_T}cross compiling; assumed OK..." >&6; }
+        LIBAVCODEC_VERSION=""
+        LIBAVCODEC_BUILD=""
 else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ffmpeg/avformat.h usability" >&5
-echo $ECHO_N "checking ffmpeg/avformat.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <ffmpeg/avformat.h>
+
+  #include <stdio.h>
+  #include <libavformat/avformat.h>
+  #include <libavcodec/avcodec.h>
+  int
+  main()
+  {
+    /* 3278080 == ((50<<16)+(5<<8)+0) == 50.5.0 */
+    if (LIBAVFORMAT_BUILD < 3278080) {
+      printf("error: transcode needs at least libavformat 50.5");
+      printf("install a cvs version after 20060814");
+      return(1);
+    }
+
+    printf("VER=%s\n", AV_STRINGIFY(LIBAVFORMAT_VERSION));
+    printf("BUILD=%d\n", LIBAVFORMAT_BUILD);
+    return(0);
+  }
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ffmpeg/avformat.h presence" >&5
-echo $ECHO_N "checking ffmpeg/avformat.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ffmpeg/avformat.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_try") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+  (exit $ac_status); }; }; then
+  LIBAVFORMAT_VERSION="`./conftest$ac_exeext | sed -ne 's,VER=\(.*\),\1,p'`"
+        LIBAVFORMAT_BUILD="`./conftest$ac_exeext | sed -ne 's,BUILD=\(.*\),\1,p'`"
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ffmpeg/avformat.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ffmpeg/avformat.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ffmpeg/avformat.h" >&5
-echo $ECHO_N "checking for ffmpeg/avformat.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_ffmpeg_avformat_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_ffmpeg_avformat_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_ffmpeg_avformat_h" >&5
-echo "${ECHO_T}$ac_cv_header_ffmpeg_avformat_h" >&6; }
-
-fi
-if test $ac_cv_header_ffmpeg_avformat_h = yes; then
-  LIBAVFORMAT_CFLAGS="$libavformat_ii"
-else
+( exit $ac_status )
+{ echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
 
 this_pkg_err="yes"
 if test x"required" != x"optional" ; then
@@ -26092,290 +25978,370 @@ if test x"required" != x"optional" ; then
   fi
   msg="ERROR: $prob: cannot compile ffmpeg/avformat.h
 ffmpeg/avformat.h can be found in the following packages:
-  libavformat  http://www.ffmpeg.org/
+  FFmpeg  http://www.ffmpeg.org
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
 
     CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libavformat" != x"no" ; then
-     LIBAVFORMAT_CFLAGS="`$PKG_CONFIG libavformat --cflags`"
   fi
+    LIBAVFORMAT_CFLAGS="$LIBAVFORMAT_CFLAGS -Dattribute_deprecated="
 
-  # get and test the _LIBS
 
-  { echo "$as_me:$LINENO: checking how to determine LIBAVFORMAT_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBAVFORMAT_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libavformat_l" != x"" ; then
-    libavformat_ll="-L$w_libavformat_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libavformat" != x"no" ; then
-      libavformat_ll="`$PKG_CONFIG libavformat --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$libavformat_config" != x"no" ; then
-        libavformat_ll="`$libavformat_config --libs`"
-        { echo "$as_me:$LINENO: result: $libavformat_config" >&5
-echo "${ECHO_T}$libavformat_config" >&6; }
-      else
-        if test x"$w_libavformat_p" != x"" ; then
-          libavformat_ll="-L$w_libavformat_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libavformat_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $libavformat_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lavformat" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  libavformat_ll="$lpaths"
-  libavformat_ll="`echo $libavformat_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $LIBAVFORMAT_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  LIBAVFORMAT_EXTRA_LIBS="$LIBAVFORMAT_EXTRA_LIBS $xl"
-  LIBAVFORMAT_EXTRA_LIBS="`echo $LIBAVFORMAT_EXTRA_LIBS | sed -e 's/  */ /g'`"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_FFMPEG 1
+_ACEOF
 
-  if test x"avformat" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libavformat_ll"
-    { echo "$as_me:$LINENO: checking for av_register_all in -lavformat" >&5
-echo $ECHO_N "checking for av_register_all in -lavformat... $ECHO_C" >&6; }
-if test "${ac_cv_lib_avformat_av_register_all+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+
+
+
+
+ if test x"$enable_ffmpeg" = x"yes"; then
+  HAVE_FFMPEG_TRUE=
+  HAVE_FFMPEG_FALSE='#'
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavformat $LIBAVFORMAT_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  HAVE_FFMPEG_TRUE='#'
+  HAVE_FFMPEG_FALSE=
+fi
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char av_register_all ();
-int
-main ()
-{
-return av_register_all ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_avformat_av_register_all=yes
+
+
+
+
+
+if test x"no" = x"required" -o x"no" = x"optional" ; then
+  enable_libv4l2="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  { echo "$as_me:$LINENO: checking whether libv4l2 support is requested" >&5
+echo $ECHO_N "checking whether libv4l2 support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-libv4l2 was given.
+if test "${enable_libv4l2+set}" = set; then
+  enableval=$enable_libv4l2; case "${enableval}" in
+      yes) ;;
+      no)  ;;
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libv4l2" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-libv4l2" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+else
+  enable_libv4l2="no"
+fi
 
-	ac_cv_lib_avformat_av_register_all=no
+  { echo "$as_me:$LINENO: result: $enable_libv4l2" >&5
+echo "${ECHO_T}$enable_libv4l2" >&6; }
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+have_libv4l2="no"
+this_pkg_err="no"
+
+if test x"$enable_libv4l2" = x"yes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBV4L2" >&5
+echo $ECHO_N "checking for LIBV4L2... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBV4L2_CFLAGS"; then
+        pkg_cv_LIBV4L2_CFLAGS="$LIBV4L2_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libv4l2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libv4l2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBV4L2_CFLAGS=`$PKG_CONFIG --cflags "libv4l2" 2>/dev/null`
+else
+  pkg_failed=yes
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_avformat_av_register_all" >&5
-echo "${ECHO_T}$ac_cv_lib_avformat_av_register_all" >&6; }
-if test $ac_cv_lib_avformat_av_register_all = yes; then
-  LIBAVFORMAT_LIBS="$libavformat_ll -lavformat $LIBAVFORMAT_EXTRA_LIBS"
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBV4L2_LIBS"; then
+        pkg_cv_LIBV4L2_LIBS="$LIBV4L2_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libv4l2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libv4l2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBV4L2_LIBS=`$PKG_CONFIG --libs "libv4l2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
 else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBV4L2_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libv4l2"`
+        else
+	        LIBV4L2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libv4l2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBV4L2_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"required" != x"optional" ; then
+if test x"LIBV4L2" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"required" = x"required" ; then
+  if test x"LIBV4L2" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libavformat' failed"
+    prob="option '--enable-libv4l2' failed"
   fi
-  msg="ERROR: $prob: cannot link against libavformat
-libavformat can be found in the following packages:
-  libavformat  http://www.ffmpeg.org/
+  msg="ERROR: $prob:
+libv4l2 can be found in the following packages:
+  libv4l2  http://hansdegoede.livejournal.com/3636.html
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
+elif test $pkg_failed = untried; then
 
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libavformat" != x"no" ; then
-     LIBAVFORMAT_LIBS="`$PKG_CONFIG libavformat --libs`"
-  fi
+this_pkg_err="yes"
+if test x"LIBV4L2" != x"optional" ; then
+  tc_pkg_err="yes"
 
-  if test x"$this_pkg_err" = x"no" ; then
-    have_libavformat="yes"
+  prob=""
+  if test x"LIBV4L2" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libv4l2' failed"
   fi
+  msg="ERROR: $prob:
+libv4l2 can be found in the following packages:
+  libv4l2  http://hansdegoede.livejournal.com/3636.html
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
 
 else
-  LIBAVFORMAT_CFLAGS=""
-  LIBAVFORMAT_LIBS=""
+	LIBV4L2_CFLAGS=$pkg_cv_LIBV4L2_CFLAGS
+	LIBV4L2_LIBS=$pkg_cv_LIBV4L2_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libv4l2="yes"
+fi
+else
+  LIBV4L2_CFLAGS=""
+  LIBV4L2_LIBS=""
 fi
 
-  fi
-  if test x"$have_libavformat" = x"yes" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $LIBAVFORMAT_CFLAGS"
-    if test "$cross_compiling" = yes; then
-  { echo "$as_me:$LINENO: result: cross compiling; assumed OK..." >&5
-echo "${ECHO_T}cross compiling; assumed OK..." >&6; }
-        LIBAVCODEC_VERSION=""
-        LIBAVCODEC_BUILD=""
+
+if test x"no" = x"required" -o x"no" = x"optional" ; then
+  enable_libv4lconvert="yes"
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  { echo "$as_me:$LINENO: checking whether libv4lconvert support is requested" >&5
+echo $ECHO_N "checking whether libv4lconvert support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-libv4lconvert was given.
+if test "${enable_libv4lconvert+set}" = set; then
+  enableval=$enable_libv4lconvert; case "${enableval}" in
+      yes) ;;
+      no)  ;;
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libv4lconvert" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-libv4lconvert" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+else
+  enable_libv4lconvert="no"
+fi
 
-  #include <stdio.h>
-  #include <libavformat/avformat.h>
-  #include <libavcodec/avcodec.h>
-  int
-  main()
-  {
-    /* 3278080 == ((50<<16)+(5<<8)+0) == 50.5.0 */
-    if (LIBAVFORMAT_BUILD < 3278080) {
-      printf("error: transcode needs at least libavformat 50.5");
-      printf("install a cvs version after 20060814");
-      return(1);
-    }
+  { echo "$as_me:$LINENO: result: $enable_libv4lconvert" >&5
+echo "${ECHO_T}$enable_libv4lconvert" >&6; }
+fi
 
-    printf("VER=%s\n", AV_STRINGIFY(LIBAVFORMAT_VERSION));
-    printf("BUILD=%d\n", LIBAVFORMAT_BUILD);
-    return(0);
-  }
+have_libv4lconvert="no"
+this_pkg_err="no"
 
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
+if test x"$enable_libv4lconvert" = x"yes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBV4LCONVERT" >&5
+echo $ECHO_N "checking for LIBV4LCONVERT... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBV4LCONVERT_CFLAGS"; then
+        pkg_cv_LIBV4LCONVERT_CFLAGS="$LIBV4LCONVERT_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libv4lconvert\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libv4lconvert") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBV4LCONVERT_CFLAGS=`$PKG_CONFIG --cflags "libv4lconvert" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBV4LCONVERT_LIBS"; then
+        pkg_cv_LIBV4LCONVERT_LIBS="$LIBV4LCONVERT_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libv4lconvert\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libv4lconvert") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  LIBAVFORMAT_VERSION="`./conftest$ac_exeext | sed -ne 's,VER=\(.*\),\1,p'`"
-        LIBAVFORMAT_BUILD="`./conftest$ac_exeext | sed -ne 's,BUILD=\(.*\),\1,p'`"
+  (exit $ac_status); }; then
+  pkg_cv_LIBV4LCONVERT_LIBS=`$PKG_CONFIG --libs "libv4lconvert" 2>/dev/null`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
 
-( exit $ac_status )
-{ echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBV4LCONVERT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libv4lconvert"`
+        else
+	        LIBV4LCONVERT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libv4lconvert"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBV4LCONVERT_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"required" != x"optional" ; then
+if test x"LIBV4LCONVERT" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"required" = x"required" ; then
+  if test x"LIBV4LCONVERT" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libavformat' failed"
+    prob="option '--enable-libv4lconvert' failed"
   fi
-  msg="ERROR: $prob: cannot compile ffmpeg/avformat.h
-ffmpeg/avformat.h can be found in the following packages:
-  FFmpeg  http://www.ffmpeg.org
+  msg="ERROR: $prob:
+libv4lconvert can be found in the following packages:
+  libv4lconvert  http://hansdegoede.livejournal.com/3636.html
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+elif test $pkg_failed = untried; then
 
+this_pkg_err="yes"
+if test x"LIBV4LCONVERT" != x"optional" ; then
+  tc_pkg_err="yes"
 
-    CPPFLAGS="$save_CPPFLAGS"
+  prob=""
+  if test x"LIBV4LCONVERT" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libv4lconvert' failed"
   fi
-    LIBAVFORMAT_CFLAGS="$LIBAVFORMAT_CFLAGS -Dattribute_deprecated="
+  msg="ERROR: $prob:
+libv4lconvert can be found in the following packages:
+  libv4lconvert  http://hansdegoede.livejournal.com/3636.html
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
+
+else
+	LIBV4LCONVERT_CFLAGS=$pkg_cv_LIBV4LCONVERT_CFLAGS
+	LIBV4LCONVERT_LIBS=$pkg_cv_LIBV4LCONVERT_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libv4lconvert="yes"
+fi
+else
+  LIBV4LCONVERT_CFLAGS=""
+  LIBV4LCONVERT_LIBS=""
+fi
 
 
+if test x"$have_libv4l2" = x"yes" ; then
+
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FFMPEG 1
+#define HAVE_LIBV4L2 1
 _ACEOF
 
 fi
+ if test x"$have_libv4l2" = x"yes"; then
+  HAVE_LIBV4L2_TRUE=
+  HAVE_LIBV4L2_FALSE='#'
+else
+  HAVE_LIBV4L2_TRUE='#'
+  HAVE_LIBV4L2_FALSE=
+fi
 
 
 
 
- if test x"$enable_ffmpeg" = x"yes"; then
-  HAVE_FFMPEG_TRUE=
-  HAVE_FFMPEG_FALSE='#'
+msg=`printf "%-30s %s" "libv4l2" "$have_libv4l2"`
+tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
+"
+
+
+if test x"$have_libv4lconvert" = x"yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBV4LCONVERT 1
+_ACEOF
+
+fi
+ if test x"$have_libv4lconvert" = x"yes"; then
+  HAVE_LIBV4LCONVERT_TRUE=
+  HAVE_LIBV4LCONVERT_FALSE='#'
 else
-  HAVE_FFMPEG_TRUE='#'
-  HAVE_FFMPEG_FALSE=
+  HAVE_LIBV4LCONVERT_TRUE='#'
+  HAVE_LIBV4LCONVERT_FALSE=
 fi
 
 
 
 
+msg=`printf "%-30s %s" "libv4lconvert" "$have_libv4lconvert"`
+tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
+"
 
 
-LIBMPEG2_EXTRA_LIBS="$LIBMPEG2_EXTRA_LIBS $($PKG_CONFIG --libs libmpeg2) $($PKG_CONFIG --libs libmpeg2convert)"
 
-if test x"required" = x"required" -o x"required" = x"optional" ; then
+if test x"no" = x"required" -o x"no" = x"optional" ; then
   enable_libmpeg2="yes"
 else
   { echo "$as_me:$LINENO: checking whether libmpeg2 support is requested" >&5
@@ -26390,458 +26356,266 @@ echo "$as_me: error: bad value ${enableval} for --enable-libmpeg2" >&2;}
    { (exit 1); exit 1; }; } ;;
     esac
 else
-  enable_libmpeg2="required"
+  enable_libmpeg2="no"
 fi
 
   { echo "$as_me:$LINENO: result: $enable_libmpeg2" >&5
 echo "${ECHO_T}$enable_libmpeg2" >&6; }
 fi
 
-
-# Check whether --with-libmpeg2-prefix was given.
-if test "${with_libmpeg2_prefix+set}" = set; then
-  withval=$with_libmpeg2_prefix; w_libmpeg2_p="$withval"
-else
-  w_libmpeg2_p=""
-fi
-
-
-
-# Check whether --with-libmpeg2-includes was given.
-if test "${with_libmpeg2_includes+set}" = set; then
-  withval=$with_libmpeg2_includes; w_libmpeg2_i="$withval"
-else
-  w_libmpeg2_i=""
-fi
-
-
-
-# Check whether --with-libmpeg2-libs was given.
-if test "${with_libmpeg2_libs+set}" = set; then
-  withval=$with_libmpeg2_libs; w_libmpeg2_l="$withval"
-else
-  w_libmpeg2_l=""
-fi
-
-
 have_libmpeg2="no"
 this_pkg_err="no"
 
 if test x"$enable_libmpeg2" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBMPEG2" >&5
+echo $ECHO_N "checking for LIBMPEG2... $ECHO_C" >&6; }
 
-  pkg_config_libmpeg2="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libmpeg2" >&5
-echo $ECHO_N "checking for pkgconfig support for libmpeg2... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG mpeg2dec --exists ; then
-      pkg_config_libmpeg2="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libmpeg2" >&5
-echo "${ECHO_T}$pkg_config_libmpeg2" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_libmpeg2_p" != x"" ; then
-      if test -x $w_libmpeg2_p/bin/no ; then
-        libmpeg2_config="$w_libmpeg2_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libmpeg2_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBMPEG2_CFLAGS"; then
+        pkg_cv_LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libmpeg2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libmpeg2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBMPEG2_CFLAGS=`$PKG_CONFIG --cflags "libmpeg2" 2>/dev/null`
 else
-  case $libmpeg2_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_libmpeg2_config="$libmpeg2_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libmpeg2_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_libmpeg2_config" && ac_cv_path_libmpeg2_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-libmpeg2_config=$ac_cv_path_libmpeg2_config
-if test -n "$libmpeg2_config"; then
-  { echo "$as_me:$LINENO: result: $libmpeg2_config" >&5
-echo "${ECHO_T}$libmpeg2_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    libmpeg2_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBMPEG2_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBMPEG2_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libmpeg2_i" != x"" ; then
-    libmpeg2_ii="-I$w_libmpeg2_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libmpeg2" != x"no" ; then
-      libmpeg2_ii="`$PKG_CONFIG mpeg2dec --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBMPEG2_LIBS"; then
+        pkg_cv_LIBMPEG2_LIBS="$LIBMPEG2_LIBS"
     else
-      if test x"$libmpeg2_config" != x"no" ; then
-        libmpeg2_ii="`$libmpeg2_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libmpeg2_config" >&5
-echo "${ECHO_T}$libmpeg2_config" >&6; }
-      else
-        if test x"$w_libmpeg2_p" != x"" ; then
-          libmpeg2_ii="-I$w_libmpeg2_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libmpeg2_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $libmpeg2_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  libmpeg2_ii="$ipaths"
-  libmpeg2_ii="`echo $libmpeg2_ii | sed -e 's/  */ /g'`"
-  LIBMPEG2_EXTRA_CFLAGS="$LIBMPEG2_EXTRA_CFLAGS $xi"
-  LIBMPEG2_EXTRA_CFLAGS="`echo $LIBMPEG2_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"mpeg2dec/mpeg2.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libmpeg2_ii"
-    if test "${ac_cv_header_mpeg2dec_mpeg2_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for mpeg2dec/mpeg2.h" >&5
-echo $ECHO_N "checking for mpeg2dec/mpeg2.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mpeg2dec_mpeg2_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mpeg2dec_mpeg2_h" >&5
-echo "${ECHO_T}$ac_cv_header_mpeg2dec_mpeg2_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking mpeg2dec/mpeg2.h usability" >&5
-echo $ECHO_N "checking mpeg2dec/mpeg2.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <mpeg2dec/mpeg2.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libmpeg2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libmpeg2") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_LIBMPEG2_LIBS=`$PKG_CONFIG --libs "libmpeg2" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking mpeg2dec/mpeg2.h presence" >&5
-echo $ECHO_N "checking mpeg2dec/mpeg2.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <mpeg2dec/mpeg2.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mpeg2dec/mpeg2.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: mpeg2dec/mpeg2.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for mpeg2dec/mpeg2.h" >&5
-echo $ECHO_N "checking for mpeg2dec/mpeg2.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mpeg2dec_mpeg2_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_mpeg2dec_mpeg2_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mpeg2dec_mpeg2_h" >&5
-echo "${ECHO_T}$ac_cv_header_mpeg2dec_mpeg2_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBMPEG2_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libmpeg2"`
+        else
+	        LIBMPEG2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libmpeg2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBMPEG2_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+this_pkg_err="yes"
+if test x"LIBMPEG2" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"LIBMPEG2" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libmpeg2' failed"
+  fi
+  msg="ERROR: $prob:
+libmpeg2 can be found in the following packages:
+  libmpeg2  http://libmpeg2.sf.net/
 
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
-if test $ac_cv_header_mpeg2dec_mpeg2_h = yes; then
-  LIBMPEG2_CFLAGS="$libmpeg2_ii"
-else
+
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"required" != x"optional" ; then
+if test x"LIBMPEG2" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"required" = x"required" ; then
+  if test x"LIBMPEG2" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-libmpeg2' failed"
   fi
-  msg="ERROR: $prob: cannot compile mpeg2dec/mpeg2.h
-mpeg2dec/mpeg2.h can be found in the following packages:
-  mpeg2dec  http://libmpeg2.sourceforge.net/
+  msg="ERROR: $prob:
+libmpeg2 can be found in the following packages:
+  libmpeg2  http://libmpeg2.sf.net/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	LIBMPEG2_CFLAGS=$pkg_cv_LIBMPEG2_CFLAGS
+	LIBMPEG2_LIBS=$pkg_cv_LIBMPEG2_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libmpeg2="yes"
+fi
+else
+  LIBMPEG2_CFLAGS=""
+  LIBMPEG2_LIBS=""
 fi
 
 
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libmpeg2" != x"no" ; then
-     LIBMPEG2_CFLAGS="`$PKG_CONFIG mpeg2dec --cflags`"
-  fi
+if test x"no" = x"required" -o x"no" = x"optional" ; then
+  enable_libmpeg2convert="yes"
+else
+  { echo "$as_me:$LINENO: checking whether libmpeg2convert support is requested" >&5
+echo $ECHO_N "checking whether libmpeg2convert support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-libmpeg2convert was given.
+if test "${enable_libmpeg2convert+set}" = set; then
+  enableval=$enable_libmpeg2convert; case "${enableval}" in
+      yes) ;;
+      no)  ;;
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libmpeg2convert" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-libmpeg2convert" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+else
+  enable_libmpeg2convert="no"
+fi
 
-  # get and test the _LIBS
+  { echo "$as_me:$LINENO: result: $enable_libmpeg2convert" >&5
+echo "${ECHO_T}$enable_libmpeg2convert" >&6; }
+fi
 
-  { echo "$as_me:$LINENO: checking how to determine LIBMPEG2_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBMPEG2_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libmpeg2_l" != x"" ; then
-    libmpeg2_ll="-L$w_libmpeg2_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libmpeg2" != x"no" ; then
-      libmpeg2_ll="`$PKG_CONFIG mpeg2dec --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+have_libmpeg2convert="no"
+this_pkg_err="no"
+
+if test x"$enable_libmpeg2convert" = x"yes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBMPEG2CONVERT" >&5
+echo $ECHO_N "checking for LIBMPEG2CONVERT... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBMPEG2CONVERT_CFLAGS"; then
+        pkg_cv_LIBMPEG2CONVERT_CFLAGS="$LIBMPEG2CONVERT_CFLAGS"
     else
-      if test x"$libmpeg2_config" != x"no" ; then
-        libmpeg2_ll="`$libmpeg2_config --libs`"
-        { echo "$as_me:$LINENO: result: $libmpeg2_config" >&5
-echo "${ECHO_T}$libmpeg2_config" >&6; }
-      else
-        if test x"$w_libmpeg2_p" != x"" ; then
-          libmpeg2_ll="-L$w_libmpeg2_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libmpeg2_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libmpeg2convert\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libmpeg2convert") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBMPEG2CONVERT_CFLAGS=`$PKG_CONFIG --cflags "libmpeg2convert" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
     fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $libmpeg2_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lmpeg2" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  libmpeg2_ll="$lpaths"
-  libmpeg2_ll="`echo $libmpeg2_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $LIBMPEG2_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  LIBMPEG2_EXTRA_LIBS="$LIBMPEG2_EXTRA_LIBS $xl"
-  LIBMPEG2_EXTRA_LIBS="`echo $LIBMPEG2_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"mpeg2" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libmpeg2_ll"
-    { echo "$as_me:$LINENO: checking for mpeg2_init in -lmpeg2" >&5
-echo $ECHO_N "checking for mpeg2_init in -lmpeg2... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mpeg2_mpeg2_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmpeg2 $LIBMPEG2_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char mpeg2_init ();
-int
-main ()
-{
-return mpeg2_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBMPEG2CONVERT_LIBS"; then
+        pkg_cv_LIBMPEG2CONVERT_LIBS="$LIBMPEG2CONVERT_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libmpeg2convert\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libmpeg2convert") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_mpeg2_mpeg2_init=yes
+  (exit $ac_status); }; then
+  pkg_cv_LIBMPEG2CONVERT_LIBS=`$PKG_CONFIG --libs "libmpeg2convert" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_mpeg2_mpeg2_init=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+    fi
+else
+	pkg_failed=untried
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpeg2_mpeg2_init" >&5
-echo "${ECHO_T}$ac_cv_lib_mpeg2_mpeg2_init" >&6; }
-if test $ac_cv_lib_mpeg2_mpeg2_init = yes; then
-  LIBMPEG2_LIBS="$libmpeg2_ll -lmpeg2 $LIBMPEG2_EXTRA_LIBS"
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBMPEG2CONVERT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libmpeg2convert"`
+        else
+	        LIBMPEG2CONVERT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libmpeg2convert"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBMPEG2CONVERT_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"required" != x"optional" ; then
+if test x"LIBMPEG2CONVERT" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"required" = x"required" ; then
+  if test x"LIBMPEG2CONVERT" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libmpeg2' failed"
+    prob="option '--enable-libmpeg2convert' failed"
   fi
-  msg="ERROR: $prob: cannot link against libmpeg2
-libmpeg2 can be found in the following packages:
-  mpeg2dec  http://libmpeg2.sourceforge.net/
+  msg="ERROR: $prob:
+libmpeg2convert can be found in the following packages:
+  libmpeg2convert  http://libmpeg2.sf.net/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
+elif test $pkg_failed = untried; then
 
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libmpeg2" != x"no" ; then
-     LIBMPEG2_LIBS="`$PKG_CONFIG mpeg2dec --libs`"
-  fi
+this_pkg_err="yes"
+if test x"LIBMPEG2CONVERT" != x"optional" ; then
+  tc_pkg_err="yes"
 
-  if test x"$this_pkg_err" = x"no" ; then
-    have_libmpeg2="yes"
+  prob=""
+  if test x"LIBMPEG2CONVERT" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libmpeg2convert' failed"
   fi
+  msg="ERROR: $prob:
+libmpeg2convert can be found in the following packages:
+  libmpeg2convert  http://libmpeg2.sf.net/
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
 
 else
-  LIBMPEG2_CFLAGS=""
-  LIBMPEG2_LIBS=""
+	LIBMPEG2CONVERT_CFLAGS=$pkg_cv_LIBMPEG2CONVERT_CFLAGS
+	LIBMPEG2CONVERT_LIBS=$pkg_cv_LIBMPEG2CONVERT_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libmpeg2convert="yes"
+fi
+else
+  LIBMPEG2CONVERT_CFLAGS=""
+  LIBMPEG2CONVERT_LIBS=""
 fi
 
 
@@ -26868,6 +26642,28 @@ tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
 "
 
 
+if test x"$have_libmpeg2convert" = x"yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBMPEG2CONVERT 1
+_ACEOF
+
+fi
+ if test x"$have_libmpeg2convert" = x"yes"; then
+  HAVE_LIBMPEG2CONVERT_TRUE=
+  HAVE_LIBMPEG2CONVERT_FALSE='#'
+else
+  HAVE_LIBMPEG2CONVERT_TRUE='#'
+  HAVE_LIBMPEG2CONVERT_FALSE=
+fi
+
+
+
+
+msg=`printf "%-30s %s" "libmpeg2convert" "$have_libmpeg2convert"`
+tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
+"
+
 
 
 { echo "$as_me:$LINENO: checking enable new or experimental components" >&5
@@ -28577,7 +28373,6 @@ fi
 done
 
 
-LIBPOSTPROC_EXTRA_LIBS="$LIBPOSTPROC_EXTRA_LIBS $($PKG_CONFIG --libs libpostproc)"
 
 if test x"no" = x"required" -o x"no" = x"optional" ; then
   enable_libpostproc="yes"
@@ -28601,448 +28396,117 @@ fi
 echo "${ECHO_T}$enable_libpostproc" >&6; }
 fi
 
-
-# Check whether --with-libpostproc-prefix was given.
-if test "${with_libpostproc_prefix+set}" = set; then
-  withval=$with_libpostproc_prefix; w_libpostproc_p="$withval"
-else
-  w_libpostproc_p=""
-fi
-
-
-
-# Check whether --with-libpostproc-includes was given.
-if test "${with_libpostproc_includes+set}" = set; then
-  withval=$with_libpostproc_includes; w_libpostproc_i="$withval"
-else
-  w_libpostproc_i=""
-fi
-
-
-
-# Check whether --with-libpostproc-libs was given.
-if test "${with_libpostproc_libs+set}" = set; then
-  withval=$with_libpostproc_libs; w_libpostproc_l="$withval"
-else
-  w_libpostproc_l=""
-fi
-
-
 have_libpostproc="no"
 this_pkg_err="no"
 
 if test x"$enable_libpostproc" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBPOSTPROC" >&5
+echo $ECHO_N "checking for LIBPOSTPROC... $ECHO_C" >&6; }
 
-  pkg_config_libpostproc="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libpostproc" >&5
-echo $ECHO_N "checking for pkgconfig support for libpostproc... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG libpostproc --exists ; then
-      pkg_config_libpostproc="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libpostproc" >&5
-echo "${ECHO_T}$pkg_config_libpostproc" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_libpostproc_p" != x"" ; then
-      if test -x $w_libpostproc_p/bin/no ; then
-        libpostproc_config="$w_libpostproc_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libpostproc_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBPOSTPROC_CFLAGS"; then
+        pkg_cv_LIBPOSTPROC_CFLAGS="$LIBPOSTPROC_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpostproc\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libpostproc") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBPOSTPROC_CFLAGS=`$PKG_CONFIG --cflags "libpostproc" 2>/dev/null`
 else
-  case $libpostproc_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_libpostproc_config="$libpostproc_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libpostproc_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_libpostproc_config" && ac_cv_path_libpostproc_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-libpostproc_config=$ac_cv_path_libpostproc_config
-if test -n "$libpostproc_config"; then
-  { echo "$as_me:$LINENO: result: $libpostproc_config" >&5
-echo "${ECHO_T}$libpostproc_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    libpostproc_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBPOSTPROC_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBPOSTPROC_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libpostproc_i" != x"" ; then
-    libpostproc_ii="-I$w_libpostproc_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libpostproc" != x"no" ; then
-      libpostproc_ii="`$PKG_CONFIG libpostproc --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBPOSTPROC_LIBS"; then
+        pkg_cv_LIBPOSTPROC_LIBS="$LIBPOSTPROC_LIBS"
     else
-      if test x"$libpostproc_config" != x"no" ; then
-        libpostproc_ii="`$libpostproc_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libpostproc_config" >&5
-echo "${ECHO_T}$libpostproc_config" >&6; }
-      else
-        if test x"$w_libpostproc_p" != x"" ; then
-          libpostproc_ii="-I$w_libpostproc_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libpostproc_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $libpostproc_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  libpostproc_ii="$ipaths"
-  libpostproc_ii="`echo $libpostproc_ii | sed -e 's/  */ /g'`"
-  LIBPOSTPROC_EXTRA_CFLAGS="$LIBPOSTPROC_EXTRA_CFLAGS $xi"
-  LIBPOSTPROC_EXTRA_CFLAGS="`echo $LIBPOSTPROC_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"libpostproc/postprocess.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libpostproc_ii"
-    if test "${ac_cv_header_libpostproc_postprocess_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for libpostproc/postprocess.h" >&5
-echo $ECHO_N "checking for libpostproc/postprocess.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libpostproc_postprocess_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libpostproc_postprocess_h" >&5
-echo "${ECHO_T}$ac_cv_header_libpostproc_postprocess_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking libpostproc/postprocess.h usability" >&5
-echo $ECHO_N "checking libpostproc/postprocess.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <libpostproc/postprocess.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libpostproc\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libpostproc") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_LIBPOSTPROC_LIBS=`$PKG_CONFIG --libs "libpostproc" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking libpostproc/postprocess.h presence" >&5
-echo $ECHO_N "checking libpostproc/postprocess.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <libpostproc/postprocess.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libpostproc/postprocess.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: libpostproc/postprocess.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for libpostproc/postprocess.h" >&5
-echo $ECHO_N "checking for libpostproc/postprocess.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libpostproc_postprocess_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_libpostproc_postprocess_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libpostproc_postprocess_h" >&5
-echo "${ECHO_T}$ac_cv_header_libpostproc_postprocess_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBPOSTPROC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpostproc"`
+        else
+	        LIBPOSTPROC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpostproc"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBPOSTPROC_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_libpostproc_postprocess_h = yes; then
-  LIBPOSTPROC_CFLAGS="$libpostproc_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"LIBPOSTPROC" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"LIBPOSTPROC" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-libpostproc' failed"
   fi
-  msg="ERROR: $prob: cannot compile libpostproc/postprocess.h
-libpostproc/postprocess.h can be found in the following packages:
-  libpostproc  http://www.ffmpeg.org/
+  msg="ERROR: $prob:
+libpostproc can be found in the following packages:
+  libpostproc  http://ffmpeg.mplayerhq.hu/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libpostproc" != x"no" ; then
-     LIBPOSTPROC_CFLAGS="`$PKG_CONFIG libpostproc --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBPOSTPROC_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBPOSTPROC_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libpostproc_l" != x"" ; then
-    libpostproc_ll="-L$w_libpostproc_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libpostproc" != x"no" ; then
-      libpostproc_ll="`$PKG_CONFIG libpostproc --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$libpostproc_config" != x"no" ; then
-        libpostproc_ll="`$libpostproc_config --libs`"
-        { echo "$as_me:$LINENO: result: $libpostproc_config" >&5
-echo "${ECHO_T}$libpostproc_config" >&6; }
-      else
-        if test x"$w_libpostproc_p" != x"" ; then
-          libpostproc_ll="-L$w_libpostproc_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libpostproc_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $libpostproc_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lpostproc" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  libpostproc_ll="$lpaths"
-  libpostproc_ll="`echo $libpostproc_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $LIBPOSTPROC_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  LIBPOSTPROC_EXTRA_LIBS="$LIBPOSTPROC_EXTRA_LIBS $xl"
-  LIBPOSTPROC_EXTRA_LIBS="`echo $LIBPOSTPROC_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"postproc" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libpostproc_ll"
-    { echo "$as_me:$LINENO: checking for pp_postprocess in -lpostproc" >&5
-echo $ECHO_N "checking for pp_postprocess in -lpostproc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_postproc_pp_postprocess+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpostproc $LIBPOSTPROC_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pp_postprocess ();
-int
-main ()
-{
-return pp_postprocess ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_postproc_pp_postprocess=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_postproc_pp_postprocess=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_postproc_pp_postprocess" >&5
-echo "${ECHO_T}$ac_cv_lib_postproc_pp_postprocess" >&6; }
-if test $ac_cv_lib_postproc_pp_postprocess = yes; then
-  LIBPOSTPROC_LIBS="$libpostproc_ll -lpostproc $LIBPOSTPROC_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"LIBPOSTPROC" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"LIBPOSTPROC" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-libpostproc' failed"
   fi
-  msg="ERROR: $prob: cannot link against libpostproc
+  msg="ERROR: $prob:
 libpostproc can be found in the following packages:
-  libpostproc  http://www.ffmpeg.org/
+  libpostproc  http://ffmpeg.mplayerhq.hu/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	LIBPOSTPROC_CFLAGS=$pkg_cv_LIBPOSTPROC_CFLAGS
+	LIBPOSTPROC_LIBS=$pkg_cv_LIBPOSTPROC_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libpostproc="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libpostproc" != x"no" ; then
-     LIBPOSTPROC_LIBS="`$PKG_CONFIG libpostproc --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_libpostproc="yes"
-  fi
-
 else
   LIBPOSTPROC_CFLAGS=""
   LIBPOSTPROC_LIBS=""
@@ -29095,448 +28559,117 @@ fi
 echo "${ECHO_T}$enable_freetype2" >&6; }
 fi
 
-
-# Check whether --with-freetype2-prefix was given.
-if test "${with_freetype2_prefix+set}" = set; then
-  withval=$with_freetype2_prefix; w_freetype2_p="$withval"
-else
-  w_freetype2_p=""
-fi
-
-
-
-# Check whether --with-freetype2-includes was given.
-if test "${with_freetype2_includes+set}" = set; then
-  withval=$with_freetype2_includes; w_freetype2_i="$withval"
-else
-  w_freetype2_i=""
-fi
-
-
-
-# Check whether --with-freetype2-libs was given.
-if test "${with_freetype2_libs+set}" = set; then
-  withval=$with_freetype2_libs; w_freetype2_l="$withval"
-else
-  w_freetype2_l=""
-fi
-
-
 have_freetype2="no"
 this_pkg_err="no"
 
 if test x"$enable_freetype2" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for FREETYPE2" >&5
+echo $ECHO_N "checking for FREETYPE2... $ECHO_C" >&6; }
 
-  pkg_config_freetype2="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for freetype2" >&5
-echo $ECHO_N "checking for pkgconfig support for freetype2... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG freetype --exists ; then
-      pkg_config_freetype2="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_freetype2" >&5
-echo "${ECHO_T}$pkg_config_freetype2" >&6; }
-
-
-  if test x"freetype-config" != x"no" ; then
-    if test x"$w_freetype2_p" != x"" ; then
-      if test -x $w_freetype2_p/bin/freetype-config ; then
-        freetype2_config="$w_freetype2_p/bin/freetype-config"
-      fi
-    fi
-    # Extract the first word of "freetype-config", so it can be a program name with args.
-set dummy freetype-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_freetype2_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$FREETYPE2_CFLAGS"; then
+        pkg_cv_FREETYPE2_CFLAGS="$FREETYPE2_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"freetype2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null`
 else
-  case $freetype2_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_freetype2_config="$freetype2_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_freetype2_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_freetype2_config" && ac_cv_path_freetype2_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-freetype2_config=$ac_cv_path_freetype2_config
-if test -n "$freetype2_config"; then
-  { echo "$as_me:$LINENO: result: $freetype2_config" >&5
-echo "${ECHO_T}$freetype2_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    freetype2_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine FREETYPE2_CFLAGS" >&5
-echo $ECHO_N "checking how to determine FREETYPE2_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_freetype2_i" != x"" ; then
-    freetype2_ii="-I$w_freetype2_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_freetype2" != x"no" ; then
-      freetype2_ii="`$PKG_CONFIG freetype --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$FREETYPE2_LIBS"; then
+        pkg_cv_FREETYPE2_LIBS="$FREETYPE2_LIBS"
     else
-      if test x"$freetype2_config" != x"no" ; then
-        freetype2_ii="`$freetype2_config --cflags`"
-        { echo "$as_me:$LINENO: result: $freetype2_config" >&5
-echo "${ECHO_T}$freetype2_config" >&6; }
-      else
-        if test x"$w_freetype2_p" != x"" ; then
-          freetype2_ii="-I$w_freetype2_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          freetype2_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $freetype2_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  freetype2_ii="$ipaths"
-  freetype2_ii="`echo $freetype2_ii | sed -e 's/  */ /g'`"
-  FREETYPE2_EXTRA_CFLAGS="$FREETYPE2_EXTRA_CFLAGS $xi"
-  FREETYPE2_EXTRA_CFLAGS="`echo $FREETYPE2_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"ft2build.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $freetype2_ii"
-    if test "${ac_cv_header_ft2build_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for ft2build.h" >&5
-echo $ECHO_N "checking for ft2build.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_ft2build_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_ft2build_h" >&5
-echo "${ECHO_T}$ac_cv_header_ft2build_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ft2build.h usability" >&5
-echo $ECHO_N "checking ft2build.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <ft2build.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"freetype2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_FREETYPE2_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ft2build.h presence" >&5
-echo $ECHO_N "checking ft2build.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ft2build.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ft2build.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ft2build.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ft2build.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ft2build.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ft2build.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ft2build.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ft2build.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ft2build.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ft2build.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ft2build.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ft2build.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ft2build.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ft2build.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ft2build.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ft2build.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ft2build.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ft2build.h" >&5
-echo $ECHO_N "checking for ft2build.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_ft2build_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_ft2build_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_ft2build_h" >&5
-echo "${ECHO_T}$ac_cv_header_ft2build_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "freetype2"`
+        else
+	        FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "freetype2"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$FREETYPE2_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_ft2build_h = yes; then
-  FREETYPE2_CFLAGS="$freetype2_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"FREETYPE2" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"FREETYPE2" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-freetype2' failed"
   fi
-  msg="ERROR: $prob: cannot compile ft2build.h
-ft2build.h can be found in the following packages:
-  freetype  http://www.freetype.org/
+  msg="ERROR: $prob:
+freetype2 can be found in the following packages:
+  freetype2  http://www.freetype.org/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_freetype2" != x"no" ; then
-     FREETYPE2_CFLAGS="`$PKG_CONFIG freetype --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine FREETYPE2_LIBS" >&5
-echo $ECHO_N "checking how to determine FREETYPE2_LIBS... $ECHO_C" >&6; }
-  if test x"$w_freetype2_l" != x"" ; then
-    freetype2_ll="-L$w_freetype2_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_freetype2" != x"no" ; then
-      freetype2_ll="`$PKG_CONFIG freetype --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$freetype2_config" != x"no" ; then
-        freetype2_ll="`$freetype2_config --libs`"
-        { echo "$as_me:$LINENO: result: $freetype2_config" >&5
-echo "${ECHO_T}$freetype2_config" >&6; }
-      else
-        if test x"$w_freetype2_p" != x"" ; then
-          freetype2_ll="-L$w_freetype2_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          freetype2_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $freetype2_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lfreetype" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  freetype2_ll="$lpaths"
-  freetype2_ll="`echo $freetype2_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $FREETYPE2_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  FREETYPE2_EXTRA_LIBS="$FREETYPE2_EXTRA_LIBS $xl"
-  FREETYPE2_EXTRA_LIBS="`echo $FREETYPE2_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"freetype" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $freetype2_ll"
-    { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
-echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
-if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreetype $FREETYPE2_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char FT_Init_FreeType ();
-int
-main ()
-{
-return FT_Init_FreeType ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_freetype_FT_Init_FreeType=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_freetype_FT_Init_FreeType=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
-echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
-  FREETYPE2_LIBS="$freetype2_ll -lfreetype $FREETYPE2_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"FREETYPE2" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"FREETYPE2" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-freetype2' failed"
   fi
-  msg="ERROR: $prob: cannot link against libfreetype
-libfreetype can be found in the following packages:
-  freetype  http://www.freetype.org/
+  msg="ERROR: $prob:
+freetype2 can be found in the following packages:
+  freetype2  http://www.freetype.org/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	FREETYPE2_CFLAGS=$pkg_cv_FREETYPE2_CFLAGS
+	FREETYPE2_LIBS=$pkg_cv_FREETYPE2_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_freetype2="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_freetype2" != x"no" ; then
-     FREETYPE2_LIBS="`$PKG_CONFIG freetype --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_freetype2="yes"
-  fi
-
 else
   FREETYPE2_CFLAGS=""
   FREETYPE2_LIBS=""
@@ -31093,448 +30226,117 @@ fi
 echo "${ECHO_T}$enable_x264" >&6; }
 fi
 
-
-# Check whether --with-x264-prefix was given.
-if test "${with_x264_prefix+set}" = set; then
-  withval=$with_x264_prefix; w_x264_p="$withval"
-else
-  w_x264_p=""
-fi
-
-
-
-# Check whether --with-x264-includes was given.
-if test "${with_x264_includes+set}" = set; then
-  withval=$with_x264_includes; w_x264_i="$withval"
-else
-  w_x264_i=""
-fi
-
-
-
-# Check whether --with-x264-libs was given.
-if test "${with_x264_libs+set}" = set; then
-  withval=$with_x264_libs; w_x264_l="$withval"
-else
-  w_x264_l=""
-fi
-
-
 have_x264="no"
 this_pkg_err="no"
 
 if test x"$enable_x264" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for X264" >&5
+echo $ECHO_N "checking for X264... $ECHO_C" >&6; }
 
-  pkg_config_x264="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for x264" >&5
-echo $ECHO_N "checking for pkgconfig support for x264... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG x264 --exists ; then
-      pkg_config_x264="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_x264" >&5
-echo "${ECHO_T}$pkg_config_x264" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_x264_p" != x"" ; then
-      if test -x $w_x264_p/bin/no ; then
-        x264_config="$w_x264_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_x264_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$X264_CFLAGS"; then
+        pkg_cv_X264_CFLAGS="$X264_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x264\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x264") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_X264_CFLAGS=`$PKG_CONFIG --cflags "x264" 2>/dev/null`
 else
-  case $x264_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_x264_config="$x264_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_x264_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_x264_config" && ac_cv_path_x264_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-x264_config=$ac_cv_path_x264_config
-if test -n "$x264_config"; then
-  { echo "$as_me:$LINENO: result: $x264_config" >&5
-echo "${ECHO_T}$x264_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    x264_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine X264_CFLAGS" >&5
-echo $ECHO_N "checking how to determine X264_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_x264_i" != x"" ; then
-    x264_ii="-I$w_x264_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_x264" != x"no" ; then
-      x264_ii="`$PKG_CONFIG x264 --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$X264_LIBS"; then
+        pkg_cv_X264_LIBS="$X264_LIBS"
     else
-      if test x"$x264_config" != x"no" ; then
-        x264_ii="`$x264_config --cflags`"
-        { echo "$as_me:$LINENO: result: $x264_config" >&5
-echo "${ECHO_T}$x264_config" >&6; }
-      else
-        if test x"$w_x264_p" != x"" ; then
-          x264_ii="-I$w_x264_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          x264_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $x264_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  x264_ii="$ipaths"
-  x264_ii="`echo $x264_ii | sed -e 's/  */ /g'`"
-  X264_EXTRA_CFLAGS="$X264_EXTRA_CFLAGS $xi"
-  X264_EXTRA_CFLAGS="`echo $X264_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"x264.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $x264_ii"
-    if test "${ac_cv_header_x264_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for x264.h" >&5
-echo $ECHO_N "checking for x264.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_x264_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_x264_h" >&5
-echo "${ECHO_T}$ac_cv_header_x264_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking x264.h usability" >&5
-echo $ECHO_N "checking x264.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <x264.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x264\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x264") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_X264_LIBS=`$PKG_CONFIG --libs "x264" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking x264.h presence" >&5
-echo $ECHO_N "checking x264.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <x264.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: x264.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: x264.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: x264.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: x264.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: x264.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: x264.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: x264.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: x264.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: x264.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: x264.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: x264.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: x264.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: x264.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: x264.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: x264.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: x264.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for x264.h" >&5
-echo $ECHO_N "checking for x264.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_x264_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_x264_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_x264_h" >&5
-echo "${ECHO_T}$ac_cv_header_x264_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        X264_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x264"`
+        else
+	        X264_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x264"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$X264_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_x264_h = yes; then
-  X264_CFLAGS="$x264_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"X264" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"X264" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-x264' failed"
   fi
-  msg="ERROR: $prob: cannot compile x264.h
-x264.h can be found in the following packages:
+  msg="ERROR: $prob:
+x264 can be found in the following packages:
   x264  http://developers.videolan.org/x264.html
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_x264" != x"no" ; then
-     X264_CFLAGS="`$PKG_CONFIG x264 --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine X264_LIBS" >&5
-echo $ECHO_N "checking how to determine X264_LIBS... $ECHO_C" >&6; }
-  if test x"$w_x264_l" != x"" ; then
-    x264_ll="-L$w_x264_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_x264" != x"no" ; then
-      x264_ll="`$PKG_CONFIG x264 --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$x264_config" != x"no" ; then
-        x264_ll="`$x264_config --libs`"
-        { echo "$as_me:$LINENO: result: $x264_config" >&5
-echo "${ECHO_T}$x264_config" >&6; }
-      else
-        if test x"$w_x264_p" != x"" ; then
-          x264_ll="-L$w_x264_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          x264_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $x264_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lx264" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  x264_ll="$lpaths"
-  x264_ll="`echo $x264_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $X264_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  X264_EXTRA_LIBS="$X264_EXTRA_LIBS $xl"
-  X264_EXTRA_LIBS="`echo $X264_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"x264" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $x264_ll"
-    { echo "$as_me:$LINENO: checking for x264_param_default in -lx264" >&5
-echo $ECHO_N "checking for x264_param_default in -lx264... $ECHO_C" >&6; }
-if test "${ac_cv_lib_x264_x264_param_default+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lx264 $X264_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char x264_param_default ();
-int
-main ()
-{
-return x264_param_default ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_x264_x264_param_default=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_x264_x264_param_default=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_x264_x264_param_default" >&5
-echo "${ECHO_T}$ac_cv_lib_x264_x264_param_default" >&6; }
-if test $ac_cv_lib_x264_x264_param_default = yes; then
-  X264_LIBS="$x264_ll -lx264 $X264_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"X264" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"X264" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-x264' failed"
   fi
-  msg="ERROR: $prob: cannot link against libx264
-libx264 can be found in the following packages:
+  msg="ERROR: $prob:
+x264 can be found in the following packages:
   x264  http://developers.videolan.org/x264.html
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	X264_CFLAGS=$pkg_cv_X264_CFLAGS
+	X264_LIBS=$pkg_cv_X264_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_x264="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_x264" != x"no" ; then
-     X264_LIBS="`$PKG_CONFIG x264 --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_x264="yes"
-  fi
-
 else
   X264_CFLAGS=""
   X264_LIBS=""
@@ -31688,458 +30490,127 @@ fi
 echo "${ECHO_T}$enable_ogg" >&6; }
 fi
 
-
-# Check whether --with-ogg-prefix was given.
-if test "${with_ogg_prefix+set}" = set; then
-  withval=$with_ogg_prefix; w_ogg_p="$withval"
-else
-  w_ogg_p=""
-fi
-
-
-
-# Check whether --with-ogg-includes was given.
-if test "${with_ogg_includes+set}" = set; then
-  withval=$with_ogg_includes; w_ogg_i="$withval"
-else
-  w_ogg_i=""
-fi
-
-
-
-# Check whether --with-ogg-libs was given.
-if test "${with_ogg_libs+set}" = set; then
-  withval=$with_ogg_libs; w_ogg_l="$withval"
-else
-  w_ogg_l=""
-fi
-
-
 have_ogg="no"
 this_pkg_err="no"
 
 if test x"$enable_ogg" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for OGG" >&5
+echo $ECHO_N "checking for OGG... $ECHO_C" >&6; }
 
-  pkg_config_ogg="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for ogg" >&5
-echo $ECHO_N "checking for pkgconfig support for ogg... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG ogg --exists ; then
-      pkg_config_ogg="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_ogg" >&5
-echo "${ECHO_T}$pkg_config_ogg" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_ogg_p" != x"" ; then
-      if test -x $w_ogg_p/bin/no ; then
-        ogg_config="$w_ogg_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ogg_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OGG_CFLAGS"; then
+        pkg_cv_OGG_CFLAGS="$OGG_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"ogg\"") >&5
+  ($PKG_CONFIG --exists --print-errors "ogg") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OGG_CFLAGS=`$PKG_CONFIG --cflags "ogg" 2>/dev/null`
 else
-  case $ogg_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ogg_config="$ogg_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ogg_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_ogg_config" && ac_cv_path_ogg_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-ogg_config=$ac_cv_path_ogg_config
-if test -n "$ogg_config"; then
-  { echo "$as_me:$LINENO: result: $ogg_config" >&5
-echo "${ECHO_T}$ogg_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    ogg_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine OGG_CFLAGS" >&5
-echo $ECHO_N "checking how to determine OGG_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_ogg_i" != x"" ; then
-    ogg_ii="-I$w_ogg_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_ogg" != x"no" ; then
-      ogg_ii="`$PKG_CONFIG ogg --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OGG_LIBS"; then
+        pkg_cv_OGG_LIBS="$OGG_LIBS"
     else
-      if test x"$ogg_config" != x"no" ; then
-        ogg_ii="`$ogg_config --cflags`"
-        { echo "$as_me:$LINENO: result: $ogg_config" >&5
-echo "${ECHO_T}$ogg_config" >&6; }
-      else
-        if test x"$w_ogg_p" != x"" ; then
-          ogg_ii="-I$w_ogg_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          ogg_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $ogg_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  ogg_ii="$ipaths"
-  ogg_ii="`echo $ogg_ii | sed -e 's/  */ /g'`"
-  OGG_EXTRA_CFLAGS="$OGG_EXTRA_CFLAGS $xi"
-  OGG_EXTRA_CFLAGS="`echo $OGG_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"ogg/ogg.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $ogg_ii"
-    if test "${ac_cv_header_ogg_ogg_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for ogg/ogg.h" >&5
-echo $ECHO_N "checking for ogg/ogg.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_ogg_ogg_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_ogg_ogg_h" >&5
-echo "${ECHO_T}$ac_cv_header_ogg_ogg_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ogg/ogg.h usability" >&5
-echo $ECHO_N "checking ogg/ogg.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <ogg/ogg.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"ogg\"") >&5
+  ($PKG_CONFIG --exists --print-errors "ogg") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_OGG_LIBS=`$PKG_CONFIG --libs "ogg" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ogg/ogg.h presence" >&5
-echo $ECHO_N "checking ogg/ogg.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ogg/ogg.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ogg/ogg.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ogg/ogg.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ogg/ogg.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ogg/ogg.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ogg/ogg.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ogg/ogg.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ogg/ogg.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ogg/ogg.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ogg/ogg.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ogg/ogg.h" >&5
-echo $ECHO_N "checking for ogg/ogg.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_ogg_ogg_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_ogg_ogg_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_ogg_ogg_h" >&5
-echo "${ECHO_T}$ac_cv_header_ogg_ogg_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        OGG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "ogg"`
+        else
+	        OGG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ogg"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$OGG_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_ogg_ogg_h = yes; then
-  OGG_CFLAGS="$ogg_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"OGG" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"OGG" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-ogg' failed"
   fi
-  msg="ERROR: $prob: cannot compile ogg/ogg.h
-ogg/ogg.h can be found in the following packages:
+  msg="ERROR: $prob:
+ogg can be found in the following packages:
   ogg  http://www.xiph.org/ogg/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_ogg" != x"no" ; then
-     OGG_CFLAGS="`$PKG_CONFIG ogg --cflags`"
-  fi
+elif test $pkg_failed = untried; then
 
-  # get and test the _LIBS
+this_pkg_err="yes"
+if test x"OGG" != x"optional" ; then
+  tc_pkg_err="yes"
 
-  { echo "$as_me:$LINENO: checking how to determine OGG_LIBS" >&5
-echo $ECHO_N "checking how to determine OGG_LIBS... $ECHO_C" >&6; }
-  if test x"$w_ogg_l" != x"" ; then
-    ogg_ll="-L$w_ogg_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
+  prob=""
+  if test x"OGG" = x"required" ; then
+    prob="requirement failed"
   else
-    if test x"$pkg_config_ogg" != x"no" ; then
-      ogg_ll="`$PKG_CONFIG ogg --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$ogg_config" != x"no" ; then
-        ogg_ll="`$ogg_config --libs`"
-        { echo "$as_me:$LINENO: result: $ogg_config" >&5
-echo "${ECHO_T}$ogg_config" >&6; }
-      else
-        if test x"$w_ogg_p" != x"" ; then
-          ogg_ll="-L$w_ogg_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          ogg_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
+    prob="option '--enable-ogg' failed"
   fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $ogg_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-logg" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  ogg_ll="$lpaths"
-  ogg_ll="`echo $ogg_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $OGG_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  OGG_EXTRA_LIBS="$OGG_EXTRA_LIBS $xl"
-  OGG_EXTRA_LIBS="`echo $OGG_EXTRA_LIBS | sed -e 's/  */ /g'`"
+  msg="ERROR: $prob:
+ogg can be found in the following packages:
+  ogg  http://www.xiph.org/ogg/
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
 
-  if test x"ogg" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $ogg_ll"
-    { echo "$as_me:$LINENO: checking for ogg_stream_init in -logg" >&5
-echo $ECHO_N "checking for ogg_stream_init in -logg... $ECHO_C" >&6; }
-if test "${ac_cv_lib_ogg_ogg_stream_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-logg $OGG_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ogg_stream_init ();
-int
-main ()
-{
-return ogg_stream_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_ogg_ogg_stream_init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ogg_ogg_stream_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ogg_ogg_stream_init" >&5
-echo "${ECHO_T}$ac_cv_lib_ogg_ogg_stream_init" >&6; }
-if test $ac_cv_lib_ogg_ogg_stream_init = yes; then
-  OGG_LIBS="$ogg_ll -logg $OGG_EXTRA_LIBS"
-else
-
-this_pkg_err="yes"
-if test x"no" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"no" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-ogg' failed"
-  fi
-  msg="ERROR: $prob: cannot link against libogg
-libogg can be found in the following packages:
-  ogg  http://www.xiph.org/ogg/
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_ogg" != x"no" ; then
-     OGG_LIBS="`$PKG_CONFIG ogg --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_ogg="yes"
-  fi
-
-else
-  OGG_CFLAGS=""
-  OGG_LIBS=""
-fi
-
-
-if test x"$have_ogg" = x"yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_OGG 1
+	OGG_CFLAGS=$pkg_cv_OGG_CFLAGS
+	OGG_LIBS=$pkg_cv_OGG_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_ogg="yes"
+fi
+else
+  OGG_CFLAGS=""
+  OGG_LIBS=""
+fi
+
+
+if test x"$have_ogg" = x"yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OGG 1
 _ACEOF
 
 fi
@@ -32159,7 +30630,6 @@ tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
 "
 
 
-VORBIS_EXTRA_LIBS="$VORBIS_EXTRA_LIBS $($PKG_CONFIG --libs vorbis)"
 
 if test x"no" = x"required" -o x"no" = x"optional" ; then
   enable_vorbis="yes"
@@ -32183,448 +30653,117 @@ fi
 echo "${ECHO_T}$enable_vorbis" >&6; }
 fi
 
-
-# Check whether --with-vorbis-prefix was given.
-if test "${with_vorbis_prefix+set}" = set; then
-  withval=$with_vorbis_prefix; w_vorbis_p="$withval"
-else
-  w_vorbis_p=""
-fi
-
-
-
-# Check whether --with-vorbis-includes was given.
-if test "${with_vorbis_includes+set}" = set; then
-  withval=$with_vorbis_includes; w_vorbis_i="$withval"
-else
-  w_vorbis_i=""
-fi
-
-
-
-# Check whether --with-vorbis-libs was given.
-if test "${with_vorbis_libs+set}" = set; then
-  withval=$with_vorbis_libs; w_vorbis_l="$withval"
-else
-  w_vorbis_l=""
-fi
-
-
 have_vorbis="no"
 this_pkg_err="no"
 
 if test x"$enable_vorbis" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for VORBIS" >&5
+echo $ECHO_N "checking for VORBIS... $ECHO_C" >&6; }
 
-  pkg_config_vorbis="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for vorbis" >&5
-echo $ECHO_N "checking for pkgconfig support for vorbis... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG vorbis --exists ; then
-      pkg_config_vorbis="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_vorbis" >&5
-echo "${ECHO_T}$pkg_config_vorbis" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_vorbis_p" != x"" ; then
-      if test -x $w_vorbis_p/bin/no ; then
-        vorbis_config="$w_vorbis_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_vorbis_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$VORBIS_CFLAGS"; then
+        pkg_cv_VORBIS_CFLAGS="$VORBIS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"vorbis\"") >&5
+  ($PKG_CONFIG --exists --print-errors "vorbis") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_VORBIS_CFLAGS=`$PKG_CONFIG --cflags "vorbis" 2>/dev/null`
 else
-  case $vorbis_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_vorbis_config="$vorbis_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_vorbis_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_vorbis_config" && ac_cv_path_vorbis_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-vorbis_config=$ac_cv_path_vorbis_config
-if test -n "$vorbis_config"; then
-  { echo "$as_me:$LINENO: result: $vorbis_config" >&5
-echo "${ECHO_T}$vorbis_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    vorbis_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine VORBIS_CFLAGS" >&5
-echo $ECHO_N "checking how to determine VORBIS_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_vorbis_i" != x"" ; then
-    vorbis_ii="-I$w_vorbis_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_vorbis" != x"no" ; then
-      vorbis_ii="`$PKG_CONFIG vorbis --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$VORBIS_LIBS"; then
+        pkg_cv_VORBIS_LIBS="$VORBIS_LIBS"
     else
-      if test x"$vorbis_config" != x"no" ; then
-        vorbis_ii="`$vorbis_config --cflags`"
-        { echo "$as_me:$LINENO: result: $vorbis_config" >&5
-echo "${ECHO_T}$vorbis_config" >&6; }
-      else
-        if test x"$w_vorbis_p" != x"" ; then
-          vorbis_ii="-I$w_vorbis_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          vorbis_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $vorbis_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  vorbis_ii="$ipaths"
-  vorbis_ii="`echo $vorbis_ii | sed -e 's/  */ /g'`"
-  VORBIS_EXTRA_CFLAGS="$VORBIS_EXTRA_CFLAGS $xi"
-  VORBIS_EXTRA_CFLAGS="`echo $VORBIS_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"vorbis/codec.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $vorbis_ii"
-    if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
-echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
-echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking vorbis/codec.h usability" >&5
-echo $ECHO_N "checking vorbis/codec.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <vorbis/codec.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"vorbis\"") >&5
+  ($PKG_CONFIG --exists --print-errors "vorbis") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_VORBIS_LIBS=`$PKG_CONFIG --libs "vorbis" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking vorbis/codec.h presence" >&5
-echo $ECHO_N "checking vorbis/codec.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <vorbis/codec.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: vorbis/codec.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: vorbis/codec.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: vorbis/codec.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
-echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_vorbis_codec_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
-echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        VORBIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbis"`
+        else
+	        VORBIS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbis"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$VORBIS_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_vorbis_codec_h = yes; then
-  VORBIS_CFLAGS="$vorbis_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"VORBIS" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"VORBIS" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-vorbis' failed"
   fi
-  msg="ERROR: $prob: cannot compile vorbis/codec.h
-vorbis/codec.h can be found in the following packages:
+  msg="ERROR: $prob:
+vorbis can be found in the following packages:
   vorbis  http://www.xiph.org/ogg/vorbis/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_vorbis" != x"no" ; then
-     VORBIS_CFLAGS="`$PKG_CONFIG vorbis --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine VORBIS_LIBS" >&5
-echo $ECHO_N "checking how to determine VORBIS_LIBS... $ECHO_C" >&6; }
-  if test x"$w_vorbis_l" != x"" ; then
-    vorbis_ll="-L$w_vorbis_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_vorbis" != x"no" ; then
-      vorbis_ll="`$PKG_CONFIG vorbis --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$vorbis_config" != x"no" ; then
-        vorbis_ll="`$vorbis_config --libs`"
-        { echo "$as_me:$LINENO: result: $vorbis_config" >&5
-echo "${ECHO_T}$vorbis_config" >&6; }
-      else
-        if test x"$w_vorbis_p" != x"" ; then
-          vorbis_ll="-L$w_vorbis_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          vorbis_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $vorbis_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lvorbis" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  vorbis_ll="$lpaths"
-  vorbis_ll="`echo $vorbis_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $VORBIS_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  VORBIS_EXTRA_LIBS="$VORBIS_EXTRA_LIBS $xl"
-  VORBIS_EXTRA_LIBS="`echo $VORBIS_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"vorbis" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $vorbis_ll"
-    { echo "$as_me:$LINENO: checking for vorbis_info_init in -lvorbis" >&5
-echo $ECHO_N "checking for vorbis_info_init in -lvorbis... $ECHO_C" >&6; }
-if test "${ac_cv_lib_vorbis_vorbis_info_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvorbis $VORBIS_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char vorbis_info_init ();
-int
-main ()
-{
-return vorbis_info_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_vorbis_vorbis_info_init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_vorbis_vorbis_info_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_vorbis_vorbis_info_init" >&5
-echo "${ECHO_T}$ac_cv_lib_vorbis_vorbis_info_init" >&6; }
-if test $ac_cv_lib_vorbis_vorbis_info_init = yes; then
-  VORBIS_LIBS="$vorbis_ll -lvorbis $VORBIS_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"VORBIS" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"VORBIS" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-vorbis' failed"
   fi
-  msg="ERROR: $prob: cannot link against libvorbis
-libvorbis can be found in the following packages:
+  msg="ERROR: $prob:
+vorbis can be found in the following packages:
   vorbis  http://www.xiph.org/ogg/vorbis/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	VORBIS_CFLAGS=$pkg_cv_VORBIS_CFLAGS
+	VORBIS_LIBS=$pkg_cv_VORBIS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_vorbis="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_vorbis" != x"no" ; then
-     VORBIS_LIBS="`$PKG_CONFIG vorbis --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_vorbis="yes"
-  fi
-
 else
   VORBIS_CFLAGS=""
   VORBIS_LIBS=""
@@ -32654,7 +30793,6 @@ tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
 "
 
 
-THEORA_EXTRA_LIBS="$THEORA_EXTRA_LIBS $($PKG_CONFIG --libs theora)"
 
 if test x"no" = x"required" -o x"no" = x"optional" ; then
   enable_theora="yes"
@@ -32678,1921 +30816,231 @@ fi
 echo "${ECHO_T}$enable_theora" >&6; }
 fi
 
-
-# Check whether --with-theora-prefix was given.
-if test "${with_theora_prefix+set}" = set; then
-  withval=$with_theora_prefix; w_theora_p="$withval"
-else
-  w_theora_p=""
-fi
-
-
-
-# Check whether --with-theora-includes was given.
-if test "${with_theora_includes+set}" = set; then
-  withval=$with_theora_includes; w_theora_i="$withval"
-else
-  w_theora_i=""
-fi
-
-
-
-# Check whether --with-theora-libs was given.
-if test "${with_theora_libs+set}" = set; then
-  withval=$with_theora_libs; w_theora_l="$withval"
-else
-  w_theora_l=""
-fi
-
-
 have_theora="no"
 this_pkg_err="no"
 
 if test x"$enable_theora" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for THEORA" >&5
+echo $ECHO_N "checking for THEORA... $ECHO_C" >&6; }
 
-  pkg_config_theora="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for theora" >&5
-echo $ECHO_N "checking for pkgconfig support for theora... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG theora --exists ; then
-      pkg_config_theora="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_theora" >&5
-echo "${ECHO_T}$pkg_config_theora" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_theora_p" != x"" ; then
-      if test -x $w_theora_p/bin/no ; then
-        theora_config="$w_theora_p/bin/no"
-      fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$THEORA_CFLAGS"; then
+        pkg_cv_THEORA_CFLAGS="$THEORA_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"theora\"") >&5
+  ($PKG_CONFIG --exists --print-errors "theora") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_THEORA_CFLAGS=`$PKG_CONFIG --cflags "theora" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
     fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_theora_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $theora_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_theora_config="$theora_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_theora_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_theora_config" && ac_cv_path_theora_config="no"
-  ;;
-esac
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$THEORA_LIBS"; then
+        pkg_cv_THEORA_LIBS="$THEORA_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"theora\"") >&5
+  ($PKG_CONFIG --exists --print-errors "theora") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_THEORA_LIBS=`$PKG_CONFIG --libs "theora" 2>/dev/null`
+else
+  pkg_failed=yes
 fi
-theora_config=$ac_cv_path_theora_config
-if test -n "$theora_config"; then
-  { echo "$as_me:$LINENO: result: $theora_config" >&5
-echo "${ECHO_T}$theora_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
 
 
-  else
-    theora_config="no"
-  fi
 
-  # get and test the _CFLAGS
+if test $pkg_failed = yes; then
 
-  { echo "$as_me:$LINENO: checking how to determine THEORA_CFLAGS" >&5
-echo $ECHO_N "checking how to determine THEORA_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_theora_i" != x"" ; then
-    theora_ii="-I$w_theora_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_theora" != x"no" ; then
-      theora_ii="`$PKG_CONFIG theora --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$theora_config" != x"no" ; then
-        theora_ii="`$theora_config --cflags`"
-        { echo "$as_me:$LINENO: result: $theora_config" >&5
-echo "${ECHO_T}$theora_config" >&6; }
-      else
-        if test x"$w_theora_p" != x"" ; then
-          theora_ii="-I$w_theora_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        THEORA_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "theora"`
         else
-          theora_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
+	        THEORA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "theora"`
         fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $theora_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  theora_ii="$ipaths"
-  theora_ii="`echo $theora_ii | sed -e 's/  */ /g'`"
-  THEORA_EXTRA_CFLAGS="$THEORA_EXTRA_CFLAGS $xi"
-  THEORA_EXTRA_CFLAGS="`echo $THEORA_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
+	# Put the nasty error message in config.log where it belongs
+	echo "$THEORA_PKG_ERRORS" >&5
 
-  if test x"theora/theora.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $theora_ii"
-    if test "${ac_cv_header_theora_theora_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for theora/theora.h" >&5
-echo $ECHO_N "checking for theora/theora.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_theora_theora_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_theora_theora_h" >&5
-echo "${ECHO_T}$ac_cv_header_theora_theora_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking theora/theora.h usability" >&5
-echo $ECHO_N "checking theora/theora.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <theora/theora.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
-	ac_header_compiler=no
-fi
+this_pkg_err="yes"
+if test x"THEORA" != x"optional" ; then
+  tc_pkg_err="yes"
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking theora/theora.h presence" >&5
-echo $ECHO_N "checking theora/theora.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <theora/theora.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: theora/theora.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: theora/theora.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: theora/theora.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: theora/theora.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: theora/theora.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: theora/theora.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: theora/theora.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: theora/theora.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: theora/theora.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for theora/theora.h" >&5
-echo $ECHO_N "checking for theora/theora.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_theora_theora_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_theora_theora_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_theora_theora_h" >&5
-echo "${ECHO_T}$ac_cv_header_theora_theora_h" >&6; }
-
-fi
-if test $ac_cv_header_theora_theora_h = yes; then
-  THEORA_CFLAGS="$theora_ii"
-else
-
-this_pkg_err="yes"
-if test x"no" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"no" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-theora' failed"
-  fi
-  msg="ERROR: $prob: cannot compile theora/theora.h
-theora/theora.h can be found in the following packages:
-  theora  http://www.theora.org/
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_theora" != x"no" ; then
-     THEORA_CFLAGS="`$PKG_CONFIG theora --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine THEORA_LIBS" >&5
-echo $ECHO_N "checking how to determine THEORA_LIBS... $ECHO_C" >&6; }
-  if test x"$w_theora_l" != x"" ; then
-    theora_ll="-L$w_theora_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_theora" != x"no" ; then
-      theora_ll="`$PKG_CONFIG theora --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$theora_config" != x"no" ; then
-        theora_ll="`$theora_config --libs`"
-        { echo "$as_me:$LINENO: result: $theora_config" >&5
-echo "${ECHO_T}$theora_config" >&6; }
-      else
-        if test x"$w_theora_p" != x"" ; then
-          theora_ll="-L$w_theora_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          theora_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $theora_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-ltheora" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  theora_ll="$lpaths"
-  theora_ll="`echo $theora_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $THEORA_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  THEORA_EXTRA_LIBS="$THEORA_EXTRA_LIBS $xl"
-  THEORA_EXTRA_LIBS="`echo $THEORA_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"theora" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $theora_ll"
-    { echo "$as_me:$LINENO: checking for theora_info_init in -ltheora" >&5
-echo $ECHO_N "checking for theora_info_init in -ltheora... $ECHO_C" >&6; }
-if test "${ac_cv_lib_theora_theora_info_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltheora $THEORA_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char theora_info_init ();
-int
-main ()
-{
-return theora_info_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_theora_theora_info_init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_theora_theora_info_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_theora_theora_info_init" >&5
-echo "${ECHO_T}$ac_cv_lib_theora_theora_info_init" >&6; }
-if test $ac_cv_lib_theora_theora_info_init = yes; then
-  THEORA_LIBS="$theora_ll -ltheora $THEORA_EXTRA_LIBS"
-else
-
-this_pkg_err="yes"
-if test x"no" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"no" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-theora' failed"
-  fi
-  msg="ERROR: $prob: cannot link against libtheora
-libtheora can be found in the following packages:
-  theora  http://www.theora.org/
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_theora" != x"no" ; then
-     THEORA_LIBS="`$PKG_CONFIG theora --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_theora="yes"
-  fi
-
-else
-  THEORA_CFLAGS=""
-  THEORA_LIBS=""
-fi
-
-
-if test x"$have_theora" = x"yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_THEORA 1
-_ACEOF
-
-fi
- if test x"$have_theora" = x"yes"; then
-  HAVE_THEORA_TRUE=
-  HAVE_THEORA_FALSE='#'
-else
-  HAVE_THEORA_TRUE='#'
-  HAVE_THEORA_FALSE=
-fi
-
-
-
-
-msg=`printf "%-30s %s" "theora" "$have_theora"`
-tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
-"
-
-
-LIBDVDREAD_EXTRA_LIBS="$LIBDVDREAD_EXTRA_LIBS -lm"
-
-if test x"yes" = x"required" -o x"yes" = x"optional" ; then
-  enable_libdvdread="yes"
-else
-  { echo "$as_me:$LINENO: checking whether libdvdread support is requested" >&5
-echo $ECHO_N "checking whether libdvdread support is requested... $ECHO_C" >&6; }
-  # Check whether --enable-libdvdread was given.
-if test "${enable_libdvdread+set}" = set; then
-  enableval=$enable_libdvdread; case "${enableval}" in
-      yes) ;;
-      no)  ;;
-      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libdvdread" >&5
-echo "$as_me: error: bad value ${enableval} for --enable-libdvdread" >&2;}
-   { (exit 1); exit 1; }; } ;;
-    esac
-else
-  enable_libdvdread="yes"
-fi
-
-  { echo "$as_me:$LINENO: result: $enable_libdvdread" >&5
-echo "${ECHO_T}$enable_libdvdread" >&6; }
-fi
-
-
-# Check whether --with-libdvdread-prefix was given.
-if test "${with_libdvdread_prefix+set}" = set; then
-  withval=$with_libdvdread_prefix; w_libdvdread_p="$withval"
-else
-  w_libdvdread_p=""
-fi
-
-
-
-# Check whether --with-libdvdread-includes was given.
-if test "${with_libdvdread_includes+set}" = set; then
-  withval=$with_libdvdread_includes; w_libdvdread_i="$withval"
-else
-  w_libdvdread_i=""
-fi
-
-
-
-# Check whether --with-libdvdread-libs was given.
-if test "${with_libdvdread_libs+set}" = set; then
-  withval=$with_libdvdread_libs; w_libdvdread_l="$withval"
-else
-  w_libdvdread_l=""
-fi
-
-
-have_libdvdread="no"
-this_pkg_err="no"
-
-if test x"$enable_libdvdread" = x"yes" ; then
-
-
-  pkg_config_libdvdread="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libdvdread" >&5
-echo $ECHO_N "checking for pkgconfig support for libdvdread... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG libdvdread --exists ; then
-      pkg_config_libdvdread="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libdvdread" >&5
-echo "${ECHO_T}$pkg_config_libdvdread" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_libdvdread_p" != x"" ; then
-      if test -x $w_libdvdread_p/bin/no ; then
-        libdvdread_config="$w_libdvdread_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libdvdread_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $libdvdread_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_libdvdread_config="$libdvdread_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libdvdread_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_libdvdread_config" && ac_cv_path_libdvdread_config="no"
-  ;;
-esac
-fi
-libdvdread_config=$ac_cv_path_libdvdread_config
-if test -n "$libdvdread_config"; then
-  { echo "$as_me:$LINENO: result: $libdvdread_config" >&5
-echo "${ECHO_T}$libdvdread_config" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  else
-    libdvdread_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBDVDREAD_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBDVDREAD_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libdvdread_i" != x"" ; then
-    libdvdread_ii="-I$w_libdvdread_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libdvdread" != x"no" ; then
-      libdvdread_ii="`$PKG_CONFIG libdvdread --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$libdvdread_config" != x"no" ; then
-        libdvdread_ii="`$libdvdread_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libdvdread_config" >&5
-echo "${ECHO_T}$libdvdread_config" >&6; }
-      else
-        if test x"$w_libdvdread_p" != x"" ; then
-          libdvdread_ii="-I$w_libdvdread_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libdvdread_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $libdvdread_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  libdvdread_ii="$ipaths"
-  libdvdread_ii="`echo $libdvdread_ii | sed -e 's/  */ /g'`"
-  LIBDVDREAD_EXTRA_CFLAGS="$LIBDVDREAD_EXTRA_CFLAGS $xi"
-  LIBDVDREAD_EXTRA_CFLAGS="`echo $LIBDVDREAD_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"none" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libdvdread_ii"
-    if test "${ac_cv_header_none+set}" = set; then
-  { echo "$as_me:$LINENO: checking for none" >&5
-echo $ECHO_N "checking for none... $ECHO_C" >&6; }
-if test "${ac_cv_header_none+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_none" >&5
-echo "${ECHO_T}$ac_cv_header_none" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking none usability" >&5
-echo $ECHO_N "checking none usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <none>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking none presence" >&5
-echo $ECHO_N "checking none presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <none>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: none: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: none: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: none: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: none: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: none: present but cannot be compiled" >&5
-echo "$as_me: WARNING: none: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: none:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: none:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: none: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: none: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: none:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: none:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: none: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: none: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: none: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: none: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for none" >&5
-echo $ECHO_N "checking for none... $ECHO_C" >&6; }
-if test "${ac_cv_header_none+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_none=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_none" >&5
-echo "${ECHO_T}$ac_cv_header_none" >&6; }
-
-fi
-if test $ac_cv_header_none = yes; then
-  LIBDVDREAD_CFLAGS="$libdvdread_ii"
-else
-
-this_pkg_err="yes"
-if test x"yes" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"yes" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-libdvdread' failed"
-  fi
-  msg="ERROR: $prob: cannot compile none
-none can be found in the following packages:
-  libdvdread  http://www.dtek.chalmers.se/groups/dvd/downloads.shtml
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libdvdread" != x"no" ; then
-     LIBDVDREAD_CFLAGS="`$PKG_CONFIG libdvdread --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBDVDREAD_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBDVDREAD_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libdvdread_l" != x"" ; then
-    libdvdread_ll="-L$w_libdvdread_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libdvdread" != x"no" ; then
-      libdvdread_ll="`$PKG_CONFIG libdvdread --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$libdvdread_config" != x"no" ; then
-        libdvdread_ll="`$libdvdread_config --libs`"
-        { echo "$as_me:$LINENO: result: $libdvdread_config" >&5
-echo "${ECHO_T}$libdvdread_config" >&6; }
-      else
-        if test x"$w_libdvdread_p" != x"" ; then
-          libdvdread_ll="-L$w_libdvdread_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libdvdread_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $libdvdread_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-ldvdread" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  libdvdread_ll="$lpaths"
-  libdvdread_ll="`echo $libdvdread_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $LIBDVDREAD_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  LIBDVDREAD_EXTRA_LIBS="$LIBDVDREAD_EXTRA_LIBS $xl"
-  LIBDVDREAD_EXTRA_LIBS="`echo $LIBDVDREAD_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"dvdread" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libdvdread_ll"
-    { echo "$as_me:$LINENO: checking for DVDOpen in -ldvdread" >&5
-echo $ECHO_N "checking for DVDOpen in -ldvdread... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dvdread_DVDOpen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldvdread $LIBDVDREAD_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char DVDOpen ();
-int
-main ()
-{
-return DVDOpen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_dvdread_DVDOpen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dvdread_DVDOpen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dvdread_DVDOpen" >&5
-echo "${ECHO_T}$ac_cv_lib_dvdread_DVDOpen" >&6; }
-if test $ac_cv_lib_dvdread_DVDOpen = yes; then
-  LIBDVDREAD_LIBS="$libdvdread_ll -ldvdread $LIBDVDREAD_EXTRA_LIBS"
-else
-
-this_pkg_err="yes"
-if test x"yes" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"yes" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-libdvdread' failed"
-  fi
-  msg="ERROR: $prob: cannot link against libdvdread
-libdvdread can be found in the following packages:
-  libdvdread  http://www.dtek.chalmers.se/groups/dvd/downloads.shtml
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libdvdread" != x"no" ; then
-     LIBDVDREAD_LIBS="`$PKG_CONFIG libdvdread --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_libdvdread="yes"
-  fi
-
-else
-  LIBDVDREAD_CFLAGS=""
-  LIBDVDREAD_LIBS=""
-fi
-
-if test x"$have_libdvdread" = x"yes" ; then
-  libdvdread_inc="no"
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $libdvdread_ii"
-  if test "${ac_cv_header_dvdread_dvd_reader_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for dvdread/dvd_reader.h" >&5
-echo $ECHO_N "checking for dvdread/dvd_reader.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dvdread_dvd_reader_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dvdread_dvd_reader_h" >&5
-echo "${ECHO_T}$ac_cv_header_dvdread_dvd_reader_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dvdread/dvd_reader.h usability" >&5
-echo $ECHO_N "checking dvdread/dvd_reader.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <dvdread/dvd_reader.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dvdread/dvd_reader.h presence" >&5
-echo $ECHO_N "checking dvdread/dvd_reader.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <dvdread/dvd_reader.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dvdread/dvd_reader.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for dvdread/dvd_reader.h" >&5
-echo $ECHO_N "checking for dvdread/dvd_reader.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dvdread_dvd_reader_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_dvdread_dvd_reader_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dvdread_dvd_reader_h" >&5
-echo "${ECHO_T}$ac_cv_header_dvdread_dvd_reader_h" >&6; }
-
-fi
-if test $ac_cv_header_dvdread_dvd_reader_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBDVDREAD_INC 1
-_ACEOF
-
-    libdvdread_inc="yes"
-fi
-
-
-  if test x"$libdvdread_inc" = x"no" ; then
-    if test "${ac_cv_header_dvd_reader_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for dvd_reader.h" >&5
-echo $ECHO_N "checking for dvd_reader.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dvd_reader_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dvd_reader_h" >&5
-echo "${ECHO_T}$ac_cv_header_dvd_reader_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dvd_reader.h usability" >&5
-echo $ECHO_N "checking dvd_reader.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <dvd_reader.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dvd_reader.h presence" >&5
-echo $ECHO_N "checking dvd_reader.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <dvd_reader.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dvd_reader.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dvd_reader.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dvd_reader.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dvd_reader.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dvd_reader.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dvd_reader.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for dvd_reader.h" >&5
-echo $ECHO_N "checking for dvd_reader.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dvd_reader_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_dvd_reader_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dvd_reader_h" >&5
-echo "${ECHO_T}$ac_cv_header_dvd_reader_h" >&6; }
-
-fi
-if test $ac_cv_header_dvd_reader_h = yes; then
-  libdvdread_inc="yes"
-fi
-
-
-  fi
-  CPPFLAGS="$save_CPPFLAGS"
-  if test x"$libdvdread_inc" = x"no" ; then
-    have_libdvdread="no"
-
-this_pkg_err="yes"
-if test x"yes" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"yes" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-libdvdread' failed"
-  fi
-  msg="ERROR: $prob: cannot compile dvd_reader.h
-dvd_reader.h can be found in the following packages:
-  libdvdread  http://www.dtek.chalmers.se/groups/dvd/downloads.shtml
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-  else
-    LIBDVDREAD_CFLAGS="$libdvdread_ii"
-  fi
-fi
-
-if test x"$have_libdvdread" = x"yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBDVDREAD 1
-_ACEOF
-
-fi
- if test x"$have_libdvdread" = x"yes"; then
-  HAVE_LIBDVDREAD_TRUE=
-  HAVE_LIBDVDREAD_FALSE='#'
-else
-  HAVE_LIBDVDREAD_TRUE='#'
-  HAVE_LIBDVDREAD_FALSE=
-fi
-
-
-
-
-msg=`printf "%-30s %s" "libdvdread" "$have_libdvdread"`
-tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
-"
-
-
-PVM3_EXTRA_LIBS="$PVM3_EXTRA_LIBS -lgpvm3"
-
-if test x"no" = x"required" -o x"no" = x"optional" ; then
-  enable_pvm3="yes"
-else
-  { echo "$as_me:$LINENO: checking whether pvm3 support is requested" >&5
-echo $ECHO_N "checking whether pvm3 support is requested... $ECHO_C" >&6; }
-  # Check whether --enable-pvm3 was given.
-if test "${enable_pvm3+set}" = set; then
-  enableval=$enable_pvm3; case "${enableval}" in
-      yes) ;;
-      no)  ;;
-      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-pvm3" >&5
-echo "$as_me: error: bad value ${enableval} for --enable-pvm3" >&2;}
-   { (exit 1); exit 1; }; } ;;
-    esac
-else
-  enable_pvm3="no"
-fi
-
-  { echo "$as_me:$LINENO: result: $enable_pvm3" >&5
-echo "${ECHO_T}$enable_pvm3" >&6; }
-fi
-
-
-# Check whether --with-pvm3-prefix was given.
-if test "${with_pvm3_prefix+set}" = set; then
-  withval=$with_pvm3_prefix; w_pvm3_p="$withval"
-else
-  w_pvm3_p=""
-fi
-
-
-
-# Check whether --with-pvm3-includes was given.
-if test "${with_pvm3_includes+set}" = set; then
-  withval=$with_pvm3_includes; w_pvm3_i="$withval"
-else
-  w_pvm3_i=""
-fi
-
-
-
-# Check whether --with-pvm3-libs was given.
-if test "${with_pvm3_libs+set}" = set; then
-  withval=$with_pvm3_libs; w_pvm3_l="$withval"
-else
-  w_pvm3_l=""
-fi
-
-
-have_pvm3="no"
-this_pkg_err="no"
-
-if test x"$enable_pvm3" = x"yes" ; then
-
-
-  pkg_config_pvm3="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for pvm3" >&5
-echo $ECHO_N "checking for pkgconfig support for pvm3... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG pvm3 --exists ; then
-      pkg_config_pvm3="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_pvm3" >&5
-echo "${ECHO_T}$pkg_config_pvm3" >&6; }
-
-
-  if test x"no" != x"no" ; then
-    if test x"$w_pvm3_p" != x"" ; then
-      if test -x $w_pvm3_p/bin/no ; then
-        pvm3_config="$w_pvm3_p/bin/no"
-      fi
-    fi
-    # Extract the first word of "no", so it can be a program name with args.
-set dummy no; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_pvm3_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $pvm3_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_pvm3_config="$pvm3_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_pvm3_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_pvm3_config" && ac_cv_path_pvm3_config="no"
-  ;;
-esac
-fi
-pvm3_config=$ac_cv_path_pvm3_config
-if test -n "$pvm3_config"; then
-  { echo "$as_me:$LINENO: result: $pvm3_config" >&5
-echo "${ECHO_T}$pvm3_config" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  else
-    pvm3_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine PVM3_CFLAGS" >&5
-echo $ECHO_N "checking how to determine PVM3_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_pvm3_i" != x"" ; then
-    pvm3_ii="-I$w_pvm3_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_pvm3" != x"no" ; then
-      pvm3_ii="`$PKG_CONFIG pvm3 --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$pvm3_config" != x"no" ; then
-        pvm3_ii="`$pvm3_config --cflags`"
-        { echo "$as_me:$LINENO: result: $pvm3_config" >&5
-echo "${ECHO_T}$pvm3_config" >&6; }
-      else
-        if test x"$w_pvm3_p" != x"" ; then
-          pvm3_ii="-I$w_pvm3_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          pvm3_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $pvm3_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  pvm3_ii="$ipaths"
-  pvm3_ii="`echo $pvm3_ii | sed -e 's/  */ /g'`"
-  PVM3_EXTRA_CFLAGS="$PVM3_EXTRA_CFLAGS $xi"
-  PVM3_EXTRA_CFLAGS="`echo $PVM3_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"pvm3.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $pvm3_ii"
-    if test "${ac_cv_header_pvm3_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for pvm3.h" >&5
-echo $ECHO_N "checking for pvm3.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_pvm3_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_pvm3_h" >&5
-echo "${ECHO_T}$ac_cv_header_pvm3_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking pvm3.h usability" >&5
-echo $ECHO_N "checking pvm3.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <pvm3.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking pvm3.h presence" >&5
-echo $ECHO_N "checking pvm3.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <pvm3.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: pvm3.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: pvm3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pvm3.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: pvm3.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: pvm3.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: pvm3.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pvm3.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: pvm3.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pvm3.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: pvm3.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pvm3.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: pvm3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pvm3.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: pvm3.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: pvm3.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: pvm3.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for pvm3.h" >&5
-echo $ECHO_N "checking for pvm3.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_pvm3_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_header_pvm3_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_pvm3_h" >&5
-echo "${ECHO_T}$ac_cv_header_pvm3_h" >&6; }
-
-fi
-if test $ac_cv_header_pvm3_h = yes; then
-  PVM3_CFLAGS="$pvm3_ii"
-else
-
-this_pkg_err="yes"
-if test x"no" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"no" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-pvm3' failed"
-  fi
-  msg="ERROR: $prob: cannot compile pvm3.h
-pvm3.h can be found in the following packages:
-  pvm3
-
-"
-  tc_pkg_err_text="$tc_pkg_err_text$msg"
-fi
-
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_pvm3" != x"no" ; then
-     PVM3_CFLAGS="`$PKG_CONFIG pvm3 --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine PVM3_LIBS" >&5
-echo $ECHO_N "checking how to determine PVM3_LIBS... $ECHO_C" >&6; }
-  if test x"$w_pvm3_l" != x"" ; then
-    pvm3_ll="-L$w_pvm3_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_pvm3" != x"no" ; then
-      pvm3_ll="`$PKG_CONFIG pvm3 --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$pvm3_config" != x"no" ; then
-        pvm3_ll="`$pvm3_config --libs`"
-        { echo "$as_me:$LINENO: result: $pvm3_config" >&5
-echo "${ECHO_T}$pvm3_config" >&6; }
-      else
-        if test x"$w_pvm3_p" != x"" ; then
-          pvm3_ll="-L$w_pvm3_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          pvm3_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $pvm3_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lpvm3" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  pvm3_ll="$lpaths"
-  pvm3_ll="`echo $pvm3_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $PVM3_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  PVM3_EXTRA_LIBS="$PVM3_EXTRA_LIBS $xl"
-  PVM3_EXTRA_LIBS="`echo $PVM3_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"pvm3" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $pvm3_ll"
-    { echo "$as_me:$LINENO: checking for pvm_initsend in -lpvm3" >&5
-echo $ECHO_N "checking for pvm_initsend in -lpvm3... $ECHO_C" >&6; }
-if test "${ac_cv_lib_pvm3_pvm_initsend+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpvm3 $PVM3_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pvm_initsend ();
-int
-main ()
-{
-return pvm_initsend ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_pvm3_pvm_initsend=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_pvm3_pvm_initsend=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pvm3_pvm_initsend" >&5
-echo "${ECHO_T}$ac_cv_lib_pvm3_pvm_initsend" >&6; }
-if test $ac_cv_lib_pvm3_pvm_initsend = yes; then
-  PVM3_LIBS="$pvm3_ll -lpvm3 $PVM3_EXTRA_LIBS"
-else
-
-this_pkg_err="yes"
-if test x"no" != x"optional" ; then
-  tc_pkg_err="yes"
-
-  prob=""
-  if test x"no" = x"required" ; then
-    prob="requirement failed"
-  else
-    prob="option '--enable-pvm3' failed"
-  fi
-  msg="ERROR: $prob: cannot link against libpvm3
-libpvm3 can be found in the following packages:
-  pvm3
+  prob=""
+  if test x"THEORA" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-theora' failed"
+  fi
+  msg="ERROR: $prob:
+theora can be found in the following packages:
+  theora  http://www.theora.org/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_pvm3" != x"no" ; then
-     PVM3_LIBS="`$PKG_CONFIG pvm3 --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_pvm3="yes"
-  fi
-
-else
-  PVM3_CFLAGS=""
-  PVM3_LIBS=""
-fi
-
-if test x"$have_pvm3" = x"yes" ; then
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $PVM3_CFLAGS"
-  if test "$cross_compiling" = yes; then
-  { echo "$as_me:$LINENO: result: cross compiling; assumed OK..." >&5
-echo "${ECHO_T}cross compiling; assumed OK..." >&6; }
-   have_pvm3="yes"
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#include <pvm3.h>
-int main ()
-{
-  if ((PVM_MAJOR_VERSION == 3) && (PVM_MINOR_VERSION < 4))
-  {
-	printf("You need to upgrade pvm3 to version > 3.4\n");
-	return(1);
-  }
-  if (PVM_MAJOR_VERSION < 3)
-  {
-	printf("You need to upgrade pvm3 to version > 3.4\n");
-	return(1);
-  }
-  return 0;
-}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  have_pvm3="yes"
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-have_pvm3="no"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
+elif test $pkg_failed = untried; then
 
-  CPPFLAGS="$save_CPPFLAGS"
-  # also include the in-tree pvm3 headers
-  PVM3_CFLAGS="$PVM3_CFLAGS -I\$(top_srcdir)/pvm3"
-  PVM3_PVMGS="$w_pvm3_l/pvmgs"
+this_pkg_err="yes"
+if test x"THEORA" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"THEORA" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-theora' failed"
+  fi
+  msg="ERROR: $prob:
+theora can be found in the following packages:
+  theora  http://www.theora.org/
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	THEORA_CFLAGS=$pkg_cv_THEORA_CFLAGS
+	THEORA_LIBS=$pkg_cv_THEORA_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_theora="yes"
+fi
+else
+  THEORA_CFLAGS=""
+  THEORA_LIBS=""
+fi
 
-if test x"$have_pvm3" = x"yes" ; then
+
+if test x"$have_theora" = x"yes" ; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_PVM3 1
+#define HAVE_THEORA 1
 _ACEOF
 
 fi
- if test x"$have_pvm3" = x"yes"; then
-  HAVE_PVM3_TRUE=
-  HAVE_PVM3_FALSE='#'
+ if test x"$have_theora" = x"yes"; then
+  HAVE_THEORA_TRUE=
+  HAVE_THEORA_FALSE='#'
 else
-  HAVE_PVM3_TRUE='#'
-  HAVE_PVM3_FALSE=
+  HAVE_THEORA_TRUE='#'
+  HAVE_THEORA_FALSE=
 fi
 
 
 
 
-msg=`printf "%-30s %s" "pvm3" "$have_pvm3"`
+msg=`printf "%-30s %s" "theora" "$have_theora"`
 tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
 "
 
 
-LIBDV_EXTRA_LIBS="$LIBDV_EXTRA_LIBS $($PKG_CONFIG --libs libdv)"
+LIBDVDREAD_EXTRA_LIBS="$LIBDVDREAD_EXTRA_LIBS -lm"
 
-if test x"no" = x"required" -o x"no" = x"optional" ; then
-  enable_libdv="yes"
+if test x"yes" = x"required" -o x"yes" = x"optional" ; then
+  enable_libdvdread="yes"
 else
-  { echo "$as_me:$LINENO: checking whether libdv support is requested" >&5
-echo $ECHO_N "checking whether libdv support is requested... $ECHO_C" >&6; }
-  # Check whether --enable-libdv was given.
-if test "${enable_libdv+set}" = set; then
-  enableval=$enable_libdv; case "${enableval}" in
+  { echo "$as_me:$LINENO: checking whether libdvdread support is requested" >&5
+echo $ECHO_N "checking whether libdvdread support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-libdvdread was given.
+if test "${enable_libdvdread+set}" = set; then
+  enableval=$enable_libdvdread; case "${enableval}" in
       yes) ;;
       no)  ;;
-      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libdv" >&5
-echo "$as_me: error: bad value ${enableval} for --enable-libdv" >&2;}
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libdvdread" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-libdvdread" >&2;}
    { (exit 1); exit 1; }; } ;;
     esac
 else
-  enable_libdv="no"
+  enable_libdvdread="yes"
 fi
 
-  { echo "$as_me:$LINENO: result: $enable_libdv" >&5
-echo "${ECHO_T}$enable_libdv" >&6; }
+  { echo "$as_me:$LINENO: result: $enable_libdvdread" >&5
+echo "${ECHO_T}$enable_libdvdread" >&6; }
 fi
 
 
-# Check whether --with-libdv-prefix was given.
-if test "${with_libdv_prefix+set}" = set; then
-  withval=$with_libdv_prefix; w_libdv_p="$withval"
+# Check whether --with-libdvdread-prefix was given.
+if test "${with_libdvdread_prefix+set}" = set; then
+  withval=$with_libdvdread_prefix; w_libdvdread_p="$withval"
 else
-  w_libdv_p=""
+  w_libdvdread_p=""
 fi
 
 
 
-# Check whether --with-libdv-includes was given.
-if test "${with_libdv_includes+set}" = set; then
-  withval=$with_libdv_includes; w_libdv_i="$withval"
+# Check whether --with-libdvdread-includes was given.
+if test "${with_libdvdread_includes+set}" = set; then
+  withval=$with_libdvdread_includes; w_libdvdread_i="$withval"
 else
-  w_libdv_i=""
+  w_libdvdread_i=""
 fi
 
 
 
-# Check whether --with-libdv-libs was given.
-if test "${with_libdv_libs+set}" = set; then
-  withval=$with_libdv_libs; w_libdv_l="$withval"
+# Check whether --with-libdvdread-libs was given.
+if test "${with_libdvdread_libs+set}" = set; then
+  withval=$with_libdvdread_libs; w_libdvdread_l="$withval"
 else
-  w_libdv_l=""
+  w_libdvdread_l=""
 fi
 
 
-have_libdv="no"
+have_libdvdread="no"
 this_pkg_err="no"
 
-if test x"$enable_libdv" = x"yes" ; then
+if test x"$enable_libdvdread" = x"yes" ; then
 
 
-  pkg_config_libdv="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libdv" >&5
-echo $ECHO_N "checking for pkgconfig support for libdv... $ECHO_C" >&6; }
+  pkg_config_libdvdread="no"
+  { echo "$as_me:$LINENO: checking for pkgconfig support for libdvdread" >&5
+echo $ECHO_N "checking for pkgconfig support for libdvdread... $ECHO_C" >&6; }
   if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG libdv --exists ; then
-      pkg_config_libdv="yes"
+    if $PKG_CONFIG libdvdread --exists ; then
+      pkg_config_libdvdread="yes"
     fi
   fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libdv" >&5
-echo "${ECHO_T}$pkg_config_libdv" >&6; }
+  { echo "$as_me:$LINENO: result: $pkg_config_libdvdread" >&5
+echo "${ECHO_T}$pkg_config_libdvdread" >&6; }
 
 
   if test x"no" != x"no" ; then
-    if test x"$w_libdv_p" != x"" ; then
-      if test -x $w_libdv_p/bin/no ; then
-        libdv_config="$w_libdv_p/bin/no"
+    if test x"$w_libdvdread_p" != x"" ; then
+      if test -x $w_libdvdread_p/bin/no ; then
+        libdvdread_config="$w_libdvdread_p/bin/no"
       fi
     fi
     # Extract the first word of "no", so it can be a program name with args.
 set dummy no; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libdv_config+set}" = set; then
+if test "${ac_cv_path_libdvdread_config+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $libdv_config in
+  case $libdvdread_config in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_libdv_config="$libdv_config" # Let the user override the test with a path.
+  ac_cv_path_libdvdread_config="$libdvdread_config" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -34602,7 +31050,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libdv_config="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_libdvdread_config="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -34610,14 +31058,14 @@ done
 done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_libdv_config" && ac_cv_path_libdv_config="no"
+  test -z "$ac_cv_path_libdvdread_config" && ac_cv_path_libdvdread_config="no"
   ;;
 esac
 fi
-libdv_config=$ac_cv_path_libdv_config
-if test -n "$libdv_config"; then
-  { echo "$as_me:$LINENO: result: $libdv_config" >&5
-echo "${ECHO_T}$libdv_config" >&6; }
+libdvdread_config=$ac_cv_path_libdvdread_config
+if test -n "$libdvdread_config"; then
+  { echo "$as_me:$LINENO: result: $libdvdread_config" >&5
+echo "${ECHO_T}$libdvdread_config" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
@@ -34625,34 +31073,34 @@ fi
 
 
   else
-    libdv_config="no"
+    libdvdread_config="no"
   fi
 
   # get and test the _CFLAGS
 
-  { echo "$as_me:$LINENO: checking how to determine LIBDV_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBDV_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libdv_i" != x"" ; then
-    libdv_ii="-I$w_libdv_i"
+  { echo "$as_me:$LINENO: checking how to determine LIBDVDREAD_CFLAGS" >&5
+echo $ECHO_N "checking how to determine LIBDVDREAD_CFLAGS... $ECHO_C" >&6; }
+  if test x"$w_libdvdread_i" != x"" ; then
+    libdvdread_ii="-I$w_libdvdread_i"
     { echo "$as_me:$LINENO: result: user" >&5
 echo "${ECHO_T}user" >&6; }
   else
-    if test x"$pkg_config_libdv" != x"no" ; then
-      libdv_ii="`$PKG_CONFIG libdv --cflags`"
+    if test x"$pkg_config_libdvdread" != x"no" ; then
+      libdvdread_ii="`$PKG_CONFIG libdvdread --cflags`"
       { echo "$as_me:$LINENO: result: pkg-config" >&5
 echo "${ECHO_T}pkg-config" >&6; }
     else
-      if test x"$libdv_config" != x"no" ; then
-        libdv_ii="`$libdv_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libdv_config" >&5
-echo "${ECHO_T}$libdv_config" >&6; }
+      if test x"$libdvdread_config" != x"no" ; then
+        libdvdread_ii="`$libdvdread_config --cflags`"
+        { echo "$as_me:$LINENO: result: $libdvdread_config" >&5
+echo "${ECHO_T}$libdvdread_config" >&6; }
       else
-        if test x"$w_libdv_p" != x"" ; then
-          libdv_ii="-I$w_libdv_p/include"
+        if test x"$w_libdvdread_p" != x"" ; then
+          libdvdread_ii="-I$w_libdvdread_p/include"
           { echo "$as_me:$LINENO: result: prefix" >&5
 echo "${ECHO_T}prefix" >&6; }
         else
-          libdv_ii="-I/usr/include"
+          libdvdread_ii="-I/usr/include"
           { echo "$as_me:$LINENO: result: default" >&5
 echo "${ECHO_T}default" >&6; }
         fi
@@ -34660,32 +31108,32 @@ echo "${ECHO_T}default" >&6; }
     fi
   fi
   ipaths="" ; xi=""
-  for i in $libdv_ii ; do
+  for i in $libdvdread_ii ; do
     case $i in
       -I*) ipaths="$ipaths $i" ;;
         *) xi="$xi $i" ;;
     esac
   done
-  libdv_ii="$ipaths"
-  libdv_ii="`echo $libdv_ii | sed -e 's/  */ /g'`"
-  LIBDV_EXTRA_CFLAGS="$LIBDV_EXTRA_CFLAGS $xi"
-  LIBDV_EXTRA_CFLAGS="`echo $LIBDV_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
+  libdvdread_ii="$ipaths"
+  libdvdread_ii="`echo $libdvdread_ii | sed -e 's/  */ /g'`"
+  LIBDVDREAD_EXTRA_CFLAGS="$LIBDVDREAD_EXTRA_CFLAGS $xi"
+  LIBDVDREAD_EXTRA_CFLAGS="`echo $LIBDVDREAD_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
 
-  if test x"libdv/dv.h" != x"none" ; then
+  if test x"none" != x"none" ; then
     save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libdv_ii"
-    if test "${ac_cv_header_libdv_dv_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for libdv/dv.h" >&5
-echo $ECHO_N "checking for libdv/dv.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libdv_dv_h+set}" = set; then
+    CPPFLAGS="$CPPFLAGS $libdvdread_ii"
+    if test "${ac_cv_header_none+set}" = set; then
+  { echo "$as_me:$LINENO: checking for none" >&5
+echo $ECHO_N "checking for none... $ECHO_C" >&6; }
+if test "${ac_cv_header_none+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libdv_dv_h" >&5
-echo "${ECHO_T}$ac_cv_header_libdv_dv_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_none" >&5
+echo "${ECHO_T}$ac_cv_header_none" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking libdv/dv.h usability" >&5
-echo $ECHO_N "checking libdv/dv.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking none usability" >&5
+echo $ECHO_N "checking none usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -34693,7 +31141,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <libdv/dv.h>
+#include <none>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -34725,15 +31173,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking libdv/dv.h presence" >&5
-echo $ECHO_N "checking libdv/dv.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking none presence" >&5
+echo $ECHO_N "checking none presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <libdv/dv.h>
+#include <none>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -34766,56 +31214,56 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: libdv/dv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: libdv/dv.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: none: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: none: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: libdv/dv.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: libdv/dv.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: libdv/dv.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: libdv/dv.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: libdv/dv.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libdv/dv.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: libdv/dv.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none: present but cannot be compiled" >&5
+echo "$as_me: WARNING: none: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: none:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: none: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: none:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: none: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: none: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: none: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for libdv/dv.h" >&5
-echo $ECHO_N "checking for libdv/dv.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libdv_dv_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for none" >&5
+echo $ECHO_N "checking for none... $ECHO_C" >&6; }
+if test "${ac_cv_header_none+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_libdv_dv_h=$ac_header_preproc
+  ac_cv_header_none=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libdv_dv_h" >&5
-echo "${ECHO_T}$ac_cv_header_libdv_dv_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_none" >&5
+echo "${ECHO_T}$ac_cv_header_none" >&6; }
 
 fi
-if test $ac_cv_header_libdv_dv_h = yes; then
-  LIBDV_CFLAGS="$libdv_ii"
+if test $ac_cv_header_none = yes; then
+  LIBDVDREAD_CFLAGS="$libdvdread_ii"
 else
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"yes" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"yes" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libdv' failed"
+    prob="option '--enable-libdvdread' failed"
   fi
-  msg="ERROR: $prob: cannot compile libdv/dv.h
-libdv/dv.h can be found in the following packages:
-  libdv  http://libdv.sourceforge.net/
+  msg="ERROR: $prob: cannot compile none
+none can be found in the following packages:
+  libdvdread  http://www.dtek.chalmers.se/groups/dvd/downloads.shtml
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
@@ -34825,35 +31273,35 @@ fi
 
 
     CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libdv" != x"no" ; then
-     LIBDV_CFLAGS="`$PKG_CONFIG libdv --cflags`"
+  elif test x"$pkg_config_libdvdread" != x"no" ; then
+     LIBDVDREAD_CFLAGS="`$PKG_CONFIG libdvdread --cflags`"
   fi
 
   # get and test the _LIBS
 
-  { echo "$as_me:$LINENO: checking how to determine LIBDV_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBDV_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libdv_l" != x"" ; then
-    libdv_ll="-L$w_libdv_l"
+  { echo "$as_me:$LINENO: checking how to determine LIBDVDREAD_LIBS" >&5
+echo $ECHO_N "checking how to determine LIBDVDREAD_LIBS... $ECHO_C" >&6; }
+  if test x"$w_libdvdread_l" != x"" ; then
+    libdvdread_ll="-L$w_libdvdread_l"
     { echo "$as_me:$LINENO: result: user" >&5
 echo "${ECHO_T}user" >&6; }
   else
-    if test x"$pkg_config_libdv" != x"no" ; then
-      libdv_ll="`$PKG_CONFIG libdv --libs`"
+    if test x"$pkg_config_libdvdread" != x"no" ; then
+      libdvdread_ll="`$PKG_CONFIG libdvdread --libs`"
       { echo "$as_me:$LINENO: result: pkg-config" >&5
 echo "${ECHO_T}pkg-config" >&6; }
     else
-      if test x"$libdv_config" != x"no" ; then
-        libdv_ll="`$libdv_config --libs`"
-        { echo "$as_me:$LINENO: result: $libdv_config" >&5
-echo "${ECHO_T}$libdv_config" >&6; }
+      if test x"$libdvdread_config" != x"no" ; then
+        libdvdread_ll="`$libdvdread_config --libs`"
+        { echo "$as_me:$LINENO: result: $libdvdread_config" >&5
+echo "${ECHO_T}$libdvdread_config" >&6; }
       else
-        if test x"$w_libdv_p" != x"" ; then
-          libdv_ll="-L$w_libdv_p${deflib}"
+        if test x"$w_libdvdread_p" != x"" ; then
+          libdvdread_ll="-L$w_libdvdread_p${deflib}"
           { echo "$as_me:$LINENO: result: prefix" >&5
 echo "${ECHO_T}prefix" >&6; }
         else
-          libdv_ll="-L/usr${deflib}"
+          libdvdread_ll="-L/usr${deflib}"
           { echo "$as_me:$LINENO: result: default" >&5
 echo "${ECHO_T}default" >&6; }
         fi
@@ -34861,32 +31309,32 @@ echo "${ECHO_T}default" >&6; }
     fi
   fi
   lpaths="" ; xlibs="" ; xlf=""
-  for l in $libdv_ll ; do
+  for l in $libdvdread_ll ; do
     case $l in
       -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-ldv" && xlibs="$xlibs $l" ;;
+      -l*) test x"$l" != x"-ldvdread" && xlibs="$xlibs $l" ;;
         *) xlf="$xlf $l" ;;
     esac
   done
-  libdv_ll="$lpaths"
-  libdv_ll="`echo $libdv_ll | sed -e 's/  */ /g'`"
+  libdvdread_ll="$lpaths"
+  libdvdread_ll="`echo $libdvdread_ll | sed -e 's/  */ /g'`"
   xl=""
   for i in $xlibs $xlf ; do
-    echo " $LIBDV_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
+    echo " $LIBDVDREAD_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
   done
-  LIBDV_EXTRA_LIBS="$LIBDV_EXTRA_LIBS $xl"
-  LIBDV_EXTRA_LIBS="`echo $LIBDV_EXTRA_LIBS | sed -e 's/  */ /g'`"
+  LIBDVDREAD_EXTRA_LIBS="$LIBDVDREAD_EXTRA_LIBS $xl"
+  LIBDVDREAD_EXTRA_LIBS="`echo $LIBDVDREAD_EXTRA_LIBS | sed -e 's/  */ /g'`"
 
-  if test x"dv" != x"none" ; then
+  if test x"dvdread" != x"none" ; then
     save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libdv_ll"
-    { echo "$as_me:$LINENO: checking for dv_encoder_new in -ldv" >&5
-echo $ECHO_N "checking for dv_encoder_new in -ldv... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dv_dv_encoder_new+set}" = set; then
+    LDFLAGS="$LDFLAGS $libdvdread_ll"
+    { echo "$as_me:$LINENO: checking for DVDOpen in -ldvdread" >&5
+echo $ECHO_N "checking for DVDOpen in -ldvdread... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dvdread_DVDOpen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldv $LIBDV_EXTRA_LIBS $LIBS"
+LIBS="-ldvdread $LIBDVDREAD_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -34900,11 +31348,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char dv_encoder_new ();
+char DVDOpen ();
 int
 main ()
 {
-return dv_encoder_new ();
+return DVDOpen ();
   ;
   return 0;
 }
@@ -34927,37 +31375,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_dv_dv_encoder_new=yes
+  ac_cv_lib_dvdread_DVDOpen=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_dv_dv_encoder_new=no
+	ac_cv_lib_dvdread_DVDOpen=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dv_dv_encoder_new" >&5
-echo "${ECHO_T}$ac_cv_lib_dv_dv_encoder_new" >&6; }
-if test $ac_cv_lib_dv_dv_encoder_new = yes; then
-  LIBDV_LIBS="$libdv_ll -ldv $LIBDV_EXTRA_LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dvdread_DVDOpen" >&5
+echo "${ECHO_T}$ac_cv_lib_dvdread_DVDOpen" >&6; }
+if test $ac_cv_lib_dvdread_DVDOpen = yes; then
+  LIBDVDREAD_LIBS="$libdvdread_ll -ldvdread $LIBDVDREAD_EXTRA_LIBS"
 else
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"yes" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"yes" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libdv' failed"
+    prob="option '--enable-libdvdread' failed"
   fi
-  msg="ERROR: $prob: cannot link against libdv
-libdv can be found in the following packages:
-  libdv  http://libdv.sourceforge.net/
+  msg="ERROR: $prob: cannot link against libdvdread
+libdvdread can be found in the following packages:
+  libdvdread  http://www.dtek.chalmers.se/groups/dvd/downloads.shtml
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
@@ -34966,128 +31414,425 @@ fi
 fi
 
     LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libdv" != x"no" ; then
-     LIBDV_LIBS="`$PKG_CONFIG libdv --libs`"
+  elif test x"$pkg_config_libdvdread" != x"no" ; then
+     LIBDVDREAD_LIBS="`$PKG_CONFIG libdvdread --libs`"
   fi
 
   if test x"$this_pkg_err" = x"no" ; then
-    have_libdv="yes"
+    have_libdvdread="yes"
   fi
 
 else
-  LIBDV_CFLAGS=""
-  LIBDV_LIBS=""
+  LIBDVDREAD_CFLAGS=""
+  LIBDVDREAD_LIBS=""
+fi
+
+if test x"$have_libdvdread" = x"yes" ; then
+  libdvdread_inc="no"
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="$CPPFLAGS $libdvdread_ii"
+  if test "${ac_cv_header_dvdread_dvd_reader_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for dvdread/dvd_reader.h" >&5
+echo $ECHO_N "checking for dvdread/dvd_reader.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dvdread_dvd_reader_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dvdread_dvd_reader_h" >&5
+echo "${ECHO_T}$ac_cv_header_dvdread_dvd_reader_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking dvdread/dvd_reader.h usability" >&5
+echo $ECHO_N "checking dvdread/dvd_reader.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <dvdread/dvd_reader.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking dvdread/dvd_reader.h presence" >&5
+echo $ECHO_N "checking dvdread/dvd_reader.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <dvdread/dvd_reader.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvdread/dvd_reader.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: dvdread/dvd_reader.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for dvdread/dvd_reader.h" >&5
+echo $ECHO_N "checking for dvdread/dvd_reader.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dvdread_dvd_reader_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_dvdread_dvd_reader_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dvdread_dvd_reader_h" >&5
+echo "${ECHO_T}$ac_cv_header_dvdread_dvd_reader_h" >&6; }
+
+fi
+if test $ac_cv_header_dvdread_dvd_reader_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBDVDREAD_INC 1
+_ACEOF
+
+    libdvdread_inc="yes"
+fi
+
+
+  if test x"$libdvdread_inc" = x"no" ; then
+    if test "${ac_cv_header_dvd_reader_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for dvd_reader.h" >&5
+echo $ECHO_N "checking for dvd_reader.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dvd_reader_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dvd_reader_h" >&5
+echo "${ECHO_T}$ac_cv_header_dvd_reader_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking dvd_reader.h usability" >&5
+echo $ECHO_N "checking dvd_reader.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <dvd_reader.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking dvd_reader.h presence" >&5
+echo $ECHO_N "checking dvd_reader.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <dvd_reader.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dvd_reader.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: dvd_reader.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dvd_reader.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dvd_reader.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: dvd_reader.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: dvd_reader.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dvd_reader.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: dvd_reader.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: dvd_reader.h: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for dvd_reader.h" >&5
+echo $ECHO_N "checking for dvd_reader.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dvd_reader_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_dvd_reader_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dvd_reader_h" >&5
+echo "${ECHO_T}$ac_cv_header_dvd_reader_h" >&6; }
+
+fi
+if test $ac_cv_header_dvd_reader_h = yes; then
+  libdvdread_inc="yes"
+fi
+
+
+  fi
+  CPPFLAGS="$save_CPPFLAGS"
+  if test x"$libdvdread_inc" = x"no" ; then
+    have_libdvdread="no"
+
+this_pkg_err="yes"
+if test x"yes" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"yes" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libdvdread' failed"
+  fi
+  msg="ERROR: $prob: cannot compile dvd_reader.h
+dvd_reader.h can be found in the following packages:
+  libdvdread  http://www.dtek.chalmers.se/groups/dvd/downloads.shtml
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+  else
+    LIBDVDREAD_CFLAGS="$libdvdread_ii"
+  fi
+fi
 
-if test x"$have_libdv" = x"yes" ; then
+if test x"$have_libdvdread" = x"yes" ; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBDV 1
+#define HAVE_LIBDVDREAD 1
 _ACEOF
 
 fi
- if test x"$have_libdv" = x"yes"; then
-  HAVE_LIBDV_TRUE=
-  HAVE_LIBDV_FALSE='#'
+ if test x"$have_libdvdread" = x"yes"; then
+  HAVE_LIBDVDREAD_TRUE=
+  HAVE_LIBDVDREAD_FALSE='#'
 else
-  HAVE_LIBDV_TRUE='#'
-  HAVE_LIBDV_FALSE=
+  HAVE_LIBDVDREAD_TRUE='#'
+  HAVE_LIBDVDREAD_FALSE=
 fi
 
 
 
 
-msg=`printf "%-30s %s" "libdv" "$have_libdv"`
+msg=`printf "%-30s %s" "libdvdread" "$have_libdvdread"`
 tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
 "
 
 
-LIBQUICKTIME_EXTRA_LIBS="$LIBQUICKTIME_EXTRA_LIBS $($PKG_CONFIG --libs libquicktime)"
+PVM3_EXTRA_LIBS="$PVM3_EXTRA_LIBS -lgpvm3"
 
 if test x"no" = x"required" -o x"no" = x"optional" ; then
-  enable_libquicktime="yes"
+  enable_pvm3="yes"
 else
-  { echo "$as_me:$LINENO: checking whether libquicktime support is requested" >&5
-echo $ECHO_N "checking whether libquicktime support is requested... $ECHO_C" >&6; }
-  # Check whether --enable-libquicktime was given.
-if test "${enable_libquicktime+set}" = set; then
-  enableval=$enable_libquicktime; case "${enableval}" in
+  { echo "$as_me:$LINENO: checking whether pvm3 support is requested" >&5
+echo $ECHO_N "checking whether pvm3 support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-pvm3 was given.
+if test "${enable_pvm3+set}" = set; then
+  enableval=$enable_pvm3; case "${enableval}" in
       yes) ;;
       no)  ;;
-      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libquicktime" >&5
-echo "$as_me: error: bad value ${enableval} for --enable-libquicktime" >&2;}
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-pvm3" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-pvm3" >&2;}
    { (exit 1); exit 1; }; } ;;
     esac
 else
-  enable_libquicktime="no"
+  enable_pvm3="no"
 fi
 
-  { echo "$as_me:$LINENO: result: $enable_libquicktime" >&5
-echo "${ECHO_T}$enable_libquicktime" >&6; }
+  { echo "$as_me:$LINENO: result: $enable_pvm3" >&5
+echo "${ECHO_T}$enable_pvm3" >&6; }
 fi
 
 
-# Check whether --with-libquicktime-prefix was given.
-if test "${with_libquicktime_prefix+set}" = set; then
-  withval=$with_libquicktime_prefix; w_libquicktime_p="$withval"
+# Check whether --with-pvm3-prefix was given.
+if test "${with_pvm3_prefix+set}" = set; then
+  withval=$with_pvm3_prefix; w_pvm3_p="$withval"
 else
-  w_libquicktime_p=""
+  w_pvm3_p=""
 fi
 
 
 
-# Check whether --with-libquicktime-includes was given.
-if test "${with_libquicktime_includes+set}" = set; then
-  withval=$with_libquicktime_includes; w_libquicktime_i="$withval"
+# Check whether --with-pvm3-includes was given.
+if test "${with_pvm3_includes+set}" = set; then
+  withval=$with_pvm3_includes; w_pvm3_i="$withval"
 else
-  w_libquicktime_i=""
+  w_pvm3_i=""
 fi
 
 
 
-# Check whether --with-libquicktime-libs was given.
-if test "${with_libquicktime_libs+set}" = set; then
-  withval=$with_libquicktime_libs; w_libquicktime_l="$withval"
+# Check whether --with-pvm3-libs was given.
+if test "${with_pvm3_libs+set}" = set; then
+  withval=$with_pvm3_libs; w_pvm3_l="$withval"
 else
-  w_libquicktime_l=""
+  w_pvm3_l=""
 fi
 
 
-have_libquicktime="no"
+have_pvm3="no"
 this_pkg_err="no"
 
-if test x"$enable_libquicktime" = x"yes" ; then
+if test x"$enable_pvm3" = x"yes" ; then
 
 
-  pkg_config_libquicktime="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libquicktime" >&5
-echo $ECHO_N "checking for pkgconfig support for libquicktime... $ECHO_C" >&6; }
+  pkg_config_pvm3="no"
+  { echo "$as_me:$LINENO: checking for pkgconfig support for pvm3" >&5
+echo $ECHO_N "checking for pkgconfig support for pvm3... $ECHO_C" >&6; }
   if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG libquicktime --exists ; then
-      pkg_config_libquicktime="yes"
+    if $PKG_CONFIG pvm3 --exists ; then
+      pkg_config_pvm3="yes"
     fi
   fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libquicktime" >&5
-echo "${ECHO_T}$pkg_config_libquicktime" >&6; }
+  { echo "$as_me:$LINENO: result: $pkg_config_pvm3" >&5
+echo "${ECHO_T}$pkg_config_pvm3" >&6; }
 
 
   if test x"no" != x"no" ; then
-    if test x"$w_libquicktime_p" != x"" ; then
-      if test -x $w_libquicktime_p/bin/no ; then
-        libquicktime_config="$w_libquicktime_p/bin/no"
+    if test x"$w_pvm3_p" != x"" ; then
+      if test -x $w_pvm3_p/bin/no ; then
+        pvm3_config="$w_pvm3_p/bin/no"
       fi
     fi
     # Extract the first word of "no", so it can be a program name with args.
 set dummy no; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libquicktime_config+set}" = set; then
+if test "${ac_cv_path_pvm3_config+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $libquicktime_config in
+  case $pvm3_config in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_libquicktime_config="$libquicktime_config" # Let the user override the test with a path.
+  ac_cv_path_pvm3_config="$pvm3_config" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -35097,7 +31842,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libquicktime_config="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_pvm3_config="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -35105,14 +31850,14 @@ done
 done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_libquicktime_config" && ac_cv_path_libquicktime_config="no"
+  test -z "$ac_cv_path_pvm3_config" && ac_cv_path_pvm3_config="no"
   ;;
 esac
 fi
-libquicktime_config=$ac_cv_path_libquicktime_config
-if test -n "$libquicktime_config"; then
-  { echo "$as_me:$LINENO: result: $libquicktime_config" >&5
-echo "${ECHO_T}$libquicktime_config" >&6; }
+pvm3_config=$ac_cv_path_pvm3_config
+if test -n "$pvm3_config"; then
+  { echo "$as_me:$LINENO: result: $pvm3_config" >&5
+echo "${ECHO_T}$pvm3_config" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
@@ -35120,34 +31865,34 @@ fi
 
 
   else
-    libquicktime_config="no"
+    pvm3_config="no"
   fi
 
   # get and test the _CFLAGS
 
-  { echo "$as_me:$LINENO: checking how to determine LIBQUICKTIME_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBQUICKTIME_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libquicktime_i" != x"" ; then
-    libquicktime_ii="-I$w_libquicktime_i"
+  { echo "$as_me:$LINENO: checking how to determine PVM3_CFLAGS" >&5
+echo $ECHO_N "checking how to determine PVM3_CFLAGS... $ECHO_C" >&6; }
+  if test x"$w_pvm3_i" != x"" ; then
+    pvm3_ii="-I$w_pvm3_i"
     { echo "$as_me:$LINENO: result: user" >&5
 echo "${ECHO_T}user" >&6; }
   else
-    if test x"$pkg_config_libquicktime" != x"no" ; then
-      libquicktime_ii="`$PKG_CONFIG libquicktime --cflags`"
+    if test x"$pkg_config_pvm3" != x"no" ; then
+      pvm3_ii="`$PKG_CONFIG pvm3 --cflags`"
       { echo "$as_me:$LINENO: result: pkg-config" >&5
 echo "${ECHO_T}pkg-config" >&6; }
     else
-      if test x"$libquicktime_config" != x"no" ; then
-        libquicktime_ii="`$libquicktime_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libquicktime_config" >&5
-echo "${ECHO_T}$libquicktime_config" >&6; }
+      if test x"$pvm3_config" != x"no" ; then
+        pvm3_ii="`$pvm3_config --cflags`"
+        { echo "$as_me:$LINENO: result: $pvm3_config" >&5
+echo "${ECHO_T}$pvm3_config" >&6; }
       else
-        if test x"$w_libquicktime_p" != x"" ; then
-          libquicktime_ii="-I$w_libquicktime_p/include"
+        if test x"$w_pvm3_p" != x"" ; then
+          pvm3_ii="-I$w_pvm3_p/include"
           { echo "$as_me:$LINENO: result: prefix" >&5
 echo "${ECHO_T}prefix" >&6; }
         else
-          libquicktime_ii="-I/usr/include"
+          pvm3_ii="-I/usr/include"
           { echo "$as_me:$LINENO: result: default" >&5
 echo "${ECHO_T}default" >&6; }
         fi
@@ -35155,32 +31900,32 @@ echo "${ECHO_T}default" >&6; }
     fi
   fi
   ipaths="" ; xi=""
-  for i in $libquicktime_ii ; do
+  for i in $pvm3_ii ; do
     case $i in
       -I*) ipaths="$ipaths $i" ;;
         *) xi="$xi $i" ;;
     esac
   done
-  libquicktime_ii="$ipaths"
-  libquicktime_ii="`echo $libquicktime_ii | sed -e 's/  */ /g'`"
-  LIBQUICKTIME_EXTRA_CFLAGS="$LIBQUICKTIME_EXTRA_CFLAGS $xi"
-  LIBQUICKTIME_EXTRA_CFLAGS="`echo $LIBQUICKTIME_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
+  pvm3_ii="$ipaths"
+  pvm3_ii="`echo $pvm3_ii | sed -e 's/  */ /g'`"
+  PVM3_EXTRA_CFLAGS="$PVM3_EXTRA_CFLAGS $xi"
+  PVM3_EXTRA_CFLAGS="`echo $PVM3_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
 
-  if test x"quicktime.h" != x"none" ; then
+  if test x"pvm3.h" != x"none" ; then
     save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libquicktime_ii"
-    if test "${ac_cv_header_quicktime_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for quicktime.h" >&5
-echo $ECHO_N "checking for quicktime.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_quicktime_h+set}" = set; then
+    CPPFLAGS="$CPPFLAGS $pvm3_ii"
+    if test "${ac_cv_header_pvm3_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for pvm3.h" >&5
+echo $ECHO_N "checking for pvm3.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pvm3_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_quicktime_h" >&5
-echo "${ECHO_T}$ac_cv_header_quicktime_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pvm3_h" >&5
+echo "${ECHO_T}$ac_cv_header_pvm3_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking quicktime.h usability" >&5
-echo $ECHO_N "checking quicktime.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking pvm3.h usability" >&5
+echo $ECHO_N "checking pvm3.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -35188,7 +31933,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <quicktime.h>
+#include <pvm3.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -35220,15 +31965,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking quicktime.h presence" >&5
-echo $ECHO_N "checking quicktime.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking pvm3.h presence" >&5
+echo $ECHO_N "checking pvm3.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <quicktime.h>
+#include <pvm3.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -35261,41 +32006,41 @@ echo "${ECHO_T}$ac_header_preproc" >&6; }
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: quicktime.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: quicktime.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: quicktime.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: quicktime.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pvm3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pvm3.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: quicktime.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: quicktime.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: quicktime.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: quicktime.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: quicktime.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: quicktime.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: quicktime.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: quicktime.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: quicktime.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: quicktime.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: quicktime.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: quicktime.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pvm3.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pvm3.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pvm3.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pvm3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pvm3.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pvm3.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pvm3.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for quicktime.h" >&5
-echo $ECHO_N "checking for quicktime.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_quicktime_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for pvm3.h" >&5
+echo $ECHO_N "checking for pvm3.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pvm3_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_quicktime_h=$ac_header_preproc
+  ac_cv_header_pvm3_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_quicktime_h" >&5
-echo "${ECHO_T}$ac_cv_header_quicktime_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pvm3_h" >&5
+echo "${ECHO_T}$ac_cv_header_pvm3_h" >&6; }
 
 fi
-if test $ac_cv_header_quicktime_h = yes; then
-  LIBQUICKTIME_CFLAGS="$libquicktime_ii"
+if test $ac_cv_header_pvm3_h = yes; then
+  PVM3_CFLAGS="$pvm3_ii"
 else
 
 this_pkg_err="yes"
@@ -35306,11 +32051,11 @@ if test x"no" != x"optional" ; then
   if test x"no" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libquicktime' failed"
+    prob="option '--enable-pvm3' failed"
   fi
-  msg="ERROR: $prob: cannot compile quicktime.h
-quicktime.h can be found in the following packages:
-  libquicktime  http://libquicktime.sourceforge.net/
+  msg="ERROR: $prob: cannot compile pvm3.h
+pvm3.h can be found in the following packages:
+  pvm3
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
@@ -35320,35 +32065,35 @@ fi
 
 
     CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libquicktime" != x"no" ; then
-     LIBQUICKTIME_CFLAGS="`$PKG_CONFIG libquicktime --cflags`"
+  elif test x"$pkg_config_pvm3" != x"no" ; then
+     PVM3_CFLAGS="`$PKG_CONFIG pvm3 --cflags`"
   fi
 
   # get and test the _LIBS
 
-  { echo "$as_me:$LINENO: checking how to determine LIBQUICKTIME_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBQUICKTIME_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libquicktime_l" != x"" ; then
-    libquicktime_ll="-L$w_libquicktime_l"
+  { echo "$as_me:$LINENO: checking how to determine PVM3_LIBS" >&5
+echo $ECHO_N "checking how to determine PVM3_LIBS... $ECHO_C" >&6; }
+  if test x"$w_pvm3_l" != x"" ; then
+    pvm3_ll="-L$w_pvm3_l"
     { echo "$as_me:$LINENO: result: user" >&5
 echo "${ECHO_T}user" >&6; }
   else
-    if test x"$pkg_config_libquicktime" != x"no" ; then
-      libquicktime_ll="`$PKG_CONFIG libquicktime --libs`"
+    if test x"$pkg_config_pvm3" != x"no" ; then
+      pvm3_ll="`$PKG_CONFIG pvm3 --libs`"
       { echo "$as_me:$LINENO: result: pkg-config" >&5
 echo "${ECHO_T}pkg-config" >&6; }
     else
-      if test x"$libquicktime_config" != x"no" ; then
-        libquicktime_ll="`$libquicktime_config --libs`"
-        { echo "$as_me:$LINENO: result: $libquicktime_config" >&5
-echo "${ECHO_T}$libquicktime_config" >&6; }
+      if test x"$pvm3_config" != x"no" ; then
+        pvm3_ll="`$pvm3_config --libs`"
+        { echo "$as_me:$LINENO: result: $pvm3_config" >&5
+echo "${ECHO_T}$pvm3_config" >&6; }
       else
-        if test x"$w_libquicktime_p" != x"" ; then
-          libquicktime_ll="-L$w_libquicktime_p${deflib}"
+        if test x"$w_pvm3_p" != x"" ; then
+          pvm3_ll="-L$w_pvm3_p${deflib}"
           { echo "$as_me:$LINENO: result: prefix" >&5
 echo "${ECHO_T}prefix" >&6; }
         else
-          libquicktime_ll="-L/usr${deflib}"
+          pvm3_ll="-L/usr${deflib}"
           { echo "$as_me:$LINENO: result: default" >&5
 echo "${ECHO_T}default" >&6; }
         fi
@@ -35356,32 +32101,32 @@ echo "${ECHO_T}default" >&6; }
     fi
   fi
   lpaths="" ; xlibs="" ; xlf=""
-  for l in $libquicktime_ll ; do
+  for l in $pvm3_ll ; do
     case $l in
       -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lquicktime" && xlibs="$xlibs $l" ;;
+      -l*) test x"$l" != x"-lpvm3" && xlibs="$xlibs $l" ;;
         *) xlf="$xlf $l" ;;
     esac
   done
-  libquicktime_ll="$lpaths"
-  libquicktime_ll="`echo $libquicktime_ll | sed -e 's/  */ /g'`"
+  pvm3_ll="$lpaths"
+  pvm3_ll="`echo $pvm3_ll | sed -e 's/  */ /g'`"
   xl=""
   for i in $xlibs $xlf ; do
-    echo " $LIBQUICKTIME_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
+    echo " $PVM3_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
   done
-  LIBQUICKTIME_EXTRA_LIBS="$LIBQUICKTIME_EXTRA_LIBS $xl"
-  LIBQUICKTIME_EXTRA_LIBS="`echo $LIBQUICKTIME_EXTRA_LIBS | sed -e 's/  */ /g'`"
+  PVM3_EXTRA_LIBS="$PVM3_EXTRA_LIBS $xl"
+  PVM3_EXTRA_LIBS="`echo $PVM3_EXTRA_LIBS | sed -e 's/  */ /g'`"
 
-  if test x"quicktime" != x"none" ; then
+  if test x"pvm3" != x"none" ; then
     save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libquicktime_ll"
-    { echo "$as_me:$LINENO: checking for quicktime_open in -lquicktime" >&5
-echo $ECHO_N "checking for quicktime_open in -lquicktime... $ECHO_C" >&6; }
-if test "${ac_cv_lib_quicktime_quicktime_open+set}" = set; then
+    LDFLAGS="$LDFLAGS $pvm3_ll"
+    { echo "$as_me:$LINENO: checking for pvm_initsend in -lpvm3" >&5
+echo $ECHO_N "checking for pvm_initsend in -lpvm3... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pvm3_pvm_initsend+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lquicktime $LIBQUICKTIME_EXTRA_LIBS $LIBS"
+LIBS="-lpvm3 $PVM3_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -35395,11 +32140,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char quicktime_open ();
+char pvm_initsend ();
 int
 main ()
 {
-return quicktime_open ();
+return pvm_initsend ();
   ;
   return 0;
 }
@@ -35422,22 +32167,22 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_quicktime_quicktime_open=yes
+  ac_cv_lib_pvm3_pvm_initsend=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_quicktime_quicktime_open=no
+	ac_cv_lib_pvm3_pvm_initsend=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_quicktime_quicktime_open" >&5
-echo "${ECHO_T}$ac_cv_lib_quicktime_quicktime_open" >&6; }
-if test $ac_cv_lib_quicktime_quicktime_open = yes; then
-  LIBQUICKTIME_LIBS="$libquicktime_ll -lquicktime $LIBQUICKTIME_EXTRA_LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pvm3_pvm_initsend" >&5
+echo "${ECHO_T}$ac_cv_lib_pvm3_pvm_initsend" >&6; }
+if test $ac_cv_lib_pvm3_pvm_initsend = yes; then
+  PVM3_LIBS="$pvm3_ll -lpvm3 $PVM3_EXTRA_LIBS"
 else
 
 this_pkg_err="yes"
@@ -35448,11 +32193,11 @@ if test x"no" != x"optional" ; then
   if test x"no" = x"required" ; then
     prob="requirement failed"
   else
-    prob="option '--enable-libquicktime' failed"
+    prob="option '--enable-pvm3' failed"
   fi
-  msg="ERROR: $prob: cannot link against libquicktime
-libquicktime can be found in the following packages:
-  libquicktime  http://libquicktime.sourceforge.net/
+  msg="ERROR: $prob: cannot link against libpvm3
+libpvm3 can be found in the following packages:
+  pvm3
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
@@ -35461,14 +32206,412 @@ fi
 fi
 
     LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libquicktime" != x"no" ; then
-     LIBQUICKTIME_LIBS="`$PKG_CONFIG libquicktime --libs`"
+  elif test x"$pkg_config_pvm3" != x"no" ; then
+     PVM3_LIBS="`$PKG_CONFIG pvm3 --libs`"
   fi
 
   if test x"$this_pkg_err" = x"no" ; then
-    have_libquicktime="yes"
+    have_pvm3="yes"
+  fi
+
+else
+  PVM3_CFLAGS=""
+  PVM3_LIBS=""
+fi
+
+if test x"$have_pvm3" = x"yes" ; then
+  save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="$CPPFLAGS $PVM3_CFLAGS"
+  if test "$cross_compiling" = yes; then
+  { echo "$as_me:$LINENO: result: cross compiling; assumed OK..." >&5
+echo "${ECHO_T}cross compiling; assumed OK..." >&6; }
+   have_pvm3="yes"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <pvm3.h>
+int main ()
+{
+  if ((PVM_MAJOR_VERSION == 3) && (PVM_MINOR_VERSION < 4))
+  {
+	printf("You need to upgrade pvm3 to version > 3.4\n");
+	return(1);
+  }
+  if (PVM_MAJOR_VERSION < 3)
+  {
+	printf("You need to upgrade pvm3 to version > 3.4\n");
+	return(1);
+  }
+  return 0;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  have_pvm3="yes"
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+have_pvm3="no"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+  CPPFLAGS="$save_CPPFLAGS"
+  # also include the in-tree pvm3 headers
+  PVM3_CFLAGS="$PVM3_CFLAGS -I\$(top_srcdir)/pvm3"
+  PVM3_PVMGS="$w_pvm3_l/pvmgs"
+fi
+
+
+if test x"$have_pvm3" = x"yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PVM3 1
+_ACEOF
+
+fi
+ if test x"$have_pvm3" = x"yes"; then
+  HAVE_PVM3_TRUE=
+  HAVE_PVM3_FALSE='#'
+else
+  HAVE_PVM3_TRUE='#'
+  HAVE_PVM3_FALSE=
+fi
+
+
+
+
+msg=`printf "%-30s %s" "pvm3" "$have_pvm3"`
+tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
+"
+
+
+
+if test x"no" = x"required" -o x"no" = x"optional" ; then
+  enable_libdv="yes"
+else
+  { echo "$as_me:$LINENO: checking whether libdv support is requested" >&5
+echo $ECHO_N "checking whether libdv support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-libdv was given.
+if test "${enable_libdv+set}" = set; then
+  enableval=$enable_libdv; case "${enableval}" in
+      yes) ;;
+      no)  ;;
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libdv" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-libdv" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+else
+  enable_libdv="no"
+fi
+
+  { echo "$as_me:$LINENO: result: $enable_libdv" >&5
+echo "${ECHO_T}$enable_libdv" >&6; }
+fi
+
+have_libdv="no"
+this_pkg_err="no"
+
+if test x"$enable_libdv" = x"yes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBDV" >&5
+echo $ECHO_N "checking for LIBDV... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBDV_CFLAGS"; then
+        pkg_cv_LIBDV_CFLAGS="$LIBDV_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libdv\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libdv") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBDV_CFLAGS=`$PKG_CONFIG --cflags "libdv" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBDV_LIBS"; then
+        pkg_cv_LIBDV_LIBS="$LIBDV_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libdv\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libdv") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBDV_LIBS=`$PKG_CONFIG --libs "libdv" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBDV_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libdv"`
+        else
+	        LIBDV_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libdv"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBDV_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+this_pkg_err="yes"
+if test x"LIBDV" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"LIBDV" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libdv' failed"
+  fi
+  msg="ERROR: $prob:
+libdv can be found in the following packages:
+  libdv  http://libdv.sourceforge.net/
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
+
+elif test $pkg_failed = untried; then
+
+this_pkg_err="yes"
+if test x"LIBDV" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"LIBDV" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libdv' failed"
+  fi
+  msg="ERROR: $prob:
+libdv can be found in the following packages:
+  libdv  http://libdv.sourceforge.net/
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
+
+else
+	LIBDV_CFLAGS=$pkg_cv_LIBDV_CFLAGS
+	LIBDV_LIBS=$pkg_cv_LIBDV_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libdv="yes"
+fi
+else
+  LIBDV_CFLAGS=""
+  LIBDV_LIBS=""
+fi
+
+
+if test x"$have_libdv" = x"yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBDV 1
+_ACEOF
+
+fi
+ if test x"$have_libdv" = x"yes"; then
+  HAVE_LIBDV_TRUE=
+  HAVE_LIBDV_FALSE='#'
+else
+  HAVE_LIBDV_TRUE='#'
+  HAVE_LIBDV_FALSE=
+fi
+
+
+
+
+msg=`printf "%-30s %s" "libdv" "$have_libdv"`
+tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
+"
+
+
+
+if test x"no" = x"required" -o x"no" = x"optional" ; then
+  enable_libquicktime="yes"
+else
+  { echo "$as_me:$LINENO: checking whether libquicktime support is requested" >&5
+echo $ECHO_N "checking whether libquicktime support is requested... $ECHO_C" >&6; }
+  # Check whether --enable-libquicktime was given.
+if test "${enable_libquicktime+set}" = set; then
+  enableval=$enable_libquicktime; case "${enableval}" in
+      yes) ;;
+      no)  ;;
+      *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-libquicktime" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-libquicktime" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+else
+  enable_libquicktime="no"
+fi
+
+  { echo "$as_me:$LINENO: result: $enable_libquicktime" >&5
+echo "${ECHO_T}$enable_libquicktime" >&6; }
+fi
+
+have_libquicktime="no"
+this_pkg_err="no"
+
+if test x"$enable_libquicktime" = x"yes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBQUICKTIME" >&5
+echo $ECHO_N "checking for LIBQUICKTIME... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBQUICKTIME_CFLAGS"; then
+        pkg_cv_LIBQUICKTIME_CFLAGS="$LIBQUICKTIME_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libquicktime\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libquicktime") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBQUICKTIME_CFLAGS=`$PKG_CONFIG --cflags "libquicktime" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBQUICKTIME_LIBS"; then
+        pkg_cv_LIBQUICKTIME_LIBS="$LIBQUICKTIME_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libquicktime\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libquicktime") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBQUICKTIME_LIBS=`$PKG_CONFIG --libs "libquicktime" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBQUICKTIME_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libquicktime"`
+        else
+	        LIBQUICKTIME_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libquicktime"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBQUICKTIME_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+this_pkg_err="yes"
+if test x"LIBQUICKTIME" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"LIBQUICKTIME" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libquicktime' failed"
+  fi
+  msg="ERROR: $prob:
+libquicktime can be found in the following packages:
+  libquicktime  http://libquicktime.sourceforge.net/
+
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
+
+elif test $pkg_failed = untried; then
+
+this_pkg_err="yes"
+if test x"LIBQUICKTIME" != x"optional" ; then
+  tc_pkg_err="yes"
+
+  prob=""
+  if test x"LIBQUICKTIME" = x"required" ; then
+    prob="requirement failed"
+  else
+    prob="option '--enable-libquicktime' failed"
   fi
+  msg="ERROR: $prob:
+libquicktime can be found in the following packages:
+  libquicktime  http://libquicktime.sourceforge.net/
 
+"
+  tc_pkg_err_text="$tc_pkg_err_text$msg"
+fi
+
+else
+	LIBQUICKTIME_CFLAGS=$pkg_cv_LIBQUICKTIME_CFLAGS
+	LIBQUICKTIME_LIBS=$pkg_cv_LIBQUICKTIME_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libquicktime="yes"
+fi
 else
   LIBQUICKTIME_CFLAGS=""
   LIBQUICKTIME_LIBS=""
@@ -37057,7 +34200,6 @@ tc_pkg_rpt_text="$tc_pkg_rpt_text$msg
 "
 
 
-LIBXML2_EXTRA_LIBS="$LIBXML2_EXTRA_LIBS $($PKG_CONFIG --libs libxml-2.0)"
 
 if test x"no" = x"required" -o x"no" = x"optional" ; then
   enable_libxml2="yes"
@@ -37081,448 +34223,117 @@ fi
 echo "${ECHO_T}$enable_libxml2" >&6; }
 fi
 
-
-# Check whether --with-libxml2-prefix was given.
-if test "${with_libxml2_prefix+set}" = set; then
-  withval=$with_libxml2_prefix; w_libxml2_p="$withval"
-else
-  w_libxml2_p=""
-fi
-
-
-
-# Check whether --with-libxml2-includes was given.
-if test "${with_libxml2_includes+set}" = set; then
-  withval=$with_libxml2_includes; w_libxml2_i="$withval"
-else
-  w_libxml2_i=""
-fi
-
-
-
-# Check whether --with-libxml2-libs was given.
-if test "${with_libxml2_libs+set}" = set; then
-  withval=$with_libxml2_libs; w_libxml2_l="$withval"
-else
-  w_libxml2_l=""
-fi
-
-
 have_libxml2="no"
 this_pkg_err="no"
 
 if test x"$enable_libxml2" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for LIBXML2" >&5
+echo $ECHO_N "checking for LIBXML2... $ECHO_C" >&6; }
 
-  pkg_config_libxml2="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for libxml2" >&5
-echo $ECHO_N "checking for pkgconfig support for libxml2... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG libxml-2.0 --exists ; then
-      pkg_config_libxml2="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_libxml2" >&5
-echo "${ECHO_T}$pkg_config_libxml2" >&6; }
-
-
-  if test x"xml2-config" != x"no" ; then
-    if test x"$w_libxml2_p" != x"" ; then
-      if test -x $w_libxml2_p/bin/xml2-config ; then
-        libxml2_config="$w_libxml2_p/bin/xml2-config"
-      fi
-    fi
-    # Extract the first word of "xml2-config", so it can be a program name with args.
-set dummy xml2-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_libxml2_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBXML2_CFLAGS"; then
+        pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
 else
-  case $libxml2_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_libxml2_config="$libxml2_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_libxml2_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_libxml2_config" && ac_cv_path_libxml2_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-libxml2_config=$ac_cv_path_libxml2_config
-if test -n "$libxml2_config"; then
-  { echo "$as_me:$LINENO: result: $libxml2_config" >&5
-echo "${ECHO_T}$libxml2_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    libxml2_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBXML2_CFLAGS" >&5
-echo $ECHO_N "checking how to determine LIBXML2_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_libxml2_i" != x"" ; then
-    libxml2_ii="-I$w_libxml2_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libxml2" != x"no" ; then
-      libxml2_ii="`$PKG_CONFIG libxml-2.0 --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBXML2_LIBS"; then
+        pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS"
     else
-      if test x"$libxml2_config" != x"no" ; then
-        libxml2_ii="`$libxml2_config --cflags`"
-        { echo "$as_me:$LINENO: result: $libxml2_config" >&5
-echo "${ECHO_T}$libxml2_config" >&6; }
-      else
-        if test x"$w_libxml2_p" != x"" ; then
-          libxml2_ii="-I$w_libxml2_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libxml2_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $libxml2_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  libxml2_ii="$ipaths"
-  libxml2_ii="`echo $libxml2_ii | sed -e 's/  */ /g'`"
-  LIBXML2_EXTRA_CFLAGS="$LIBXML2_EXTRA_CFLAGS $xi"
-  LIBXML2_EXTRA_CFLAGS="`echo $LIBXML2_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"libxml/parser.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $libxml2_ii"
-    if test "${ac_cv_header_libxml_parser_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
-echo $ECHO_N "checking for libxml/parser.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libxml_parser_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
-echo "${ECHO_T}$ac_cv_header_libxml_parser_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking libxml/parser.h usability" >&5
-echo $ECHO_N "checking libxml/parser.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <libxml/parser.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking libxml/parser.h presence" >&5
-echo $ECHO_N "checking libxml/parser.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <libxml/parser.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: libxml/parser.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: libxml/parser.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: libxml/parser.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: libxml/parser.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: libxml/parser.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
-echo $ECHO_N "checking for libxml/parser.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libxml_parser_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_libxml_parser_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
-echo "${ECHO_T}$ac_cv_header_libxml_parser_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libxml-2.0"`
+        else
+	        LIBXML2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBXML2_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_libxml_parser_h = yes; then
-  LIBXML2_CFLAGS="$libxml2_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"LIBXML2" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"LIBXML2" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-libxml2' failed"
   fi
-  msg="ERROR: $prob: cannot compile libxml/parser.h
-libxml/parser.h can be found in the following packages:
+  msg="ERROR: $prob:
+libxml-2.0 can be found in the following packages:
   libxml-2.0  http://xmlsoft.org
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_libxml2" != x"no" ; then
-     LIBXML2_CFLAGS="`$PKG_CONFIG libxml-2.0 --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine LIBXML2_LIBS" >&5
-echo $ECHO_N "checking how to determine LIBXML2_LIBS... $ECHO_C" >&6; }
-  if test x"$w_libxml2_l" != x"" ; then
-    libxml2_ll="-L$w_libxml2_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_libxml2" != x"no" ; then
-      libxml2_ll="`$PKG_CONFIG libxml-2.0 --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$libxml2_config" != x"no" ; then
-        libxml2_ll="`$libxml2_config --libs`"
-        { echo "$as_me:$LINENO: result: $libxml2_config" >&5
-echo "${ECHO_T}$libxml2_config" >&6; }
-      else
-        if test x"$w_libxml2_p" != x"" ; then
-          libxml2_ll="-L$w_libxml2_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          libxml2_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $libxml2_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lxml2" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  libxml2_ll="$lpaths"
-  libxml2_ll="`echo $libxml2_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $LIBXML2_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  LIBXML2_EXTRA_LIBS="$LIBXML2_EXTRA_LIBS $xl"
-  LIBXML2_EXTRA_LIBS="`echo $LIBXML2_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"xml2" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $libxml2_ll"
-    { echo "$as_me:$LINENO: checking for xmlStrcmp in -lxml2" >&5
-echo $ECHO_N "checking for xmlStrcmp in -lxml2... $ECHO_C" >&6; }
-if test "${ac_cv_lib_xml2_xmlStrcmp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxml2 $LIBXML2_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char xmlStrcmp ();
-int
-main ()
-{
-return xmlStrcmp ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_xml2_xmlStrcmp=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_xml2_xmlStrcmp=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlStrcmp" >&5
-echo "${ECHO_T}$ac_cv_lib_xml2_xmlStrcmp" >&6; }
-if test $ac_cv_lib_xml2_xmlStrcmp = yes; then
-  LIBXML2_LIBS="$libxml2_ll -lxml2 $LIBXML2_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"LIBXML2" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"LIBXML2" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-libxml2' failed"
   fi
-  msg="ERROR: $prob: cannot link against libxml2
-libxml2 can be found in the following packages:
+  msg="ERROR: $prob:
+libxml-2.0 can be found in the following packages:
   libxml-2.0  http://xmlsoft.org
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS
+	LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_libxml2="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_libxml2" != x"no" ; then
-     LIBXML2_LIBS="`$PKG_CONFIG libxml-2.0 --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_libxml2="yes"
-  fi
-
 else
   LIBXML2_CFLAGS=""
   LIBXML2_LIBS=""
@@ -38118,448 +34929,117 @@ fi
 echo "${ECHO_T}$enable_mjpegtools" >&6; }
 fi
 
-
-# Check whether --with-mjpegtools-prefix was given.
-if test "${with_mjpegtools_prefix+set}" = set; then
-  withval=$with_mjpegtools_prefix; w_mjpegtools_p="$withval"
-else
-  w_mjpegtools_p=""
-fi
-
-
-
-# Check whether --with-mjpegtools-includes was given.
-if test "${with_mjpegtools_includes+set}" = set; then
-  withval=$with_mjpegtools_includes; w_mjpegtools_i="$withval"
-else
-  w_mjpegtools_i=""
-fi
-
-
-
-# Check whether --with-mjpegtools-libs was given.
-if test "${with_mjpegtools_libs+set}" = set; then
-  withval=$with_mjpegtools_libs; w_mjpegtools_l="$withval"
-else
-  w_mjpegtools_l=""
-fi
-
-
 have_mjpegtools="no"
 this_pkg_err="no"
 
 if test x"$enable_mjpegtools" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for MJPEGTOOLS" >&5
+echo $ECHO_N "checking for MJPEGTOOLS... $ECHO_C" >&6; }
 
-  pkg_config_mjpegtools="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for mjpegtools" >&5
-echo $ECHO_N "checking for pkgconfig support for mjpegtools... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG mjpegtools --exists ; then
-      pkg_config_mjpegtools="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_mjpegtools" >&5
-echo "${ECHO_T}$pkg_config_mjpegtools" >&6; }
-
-
-  if test x"mjpegtools-config" != x"no" ; then
-    if test x"$w_mjpegtools_p" != x"" ; then
-      if test -x $w_mjpegtools_p/bin/mjpegtools-config ; then
-        mjpegtools_config="$w_mjpegtools_p/bin/mjpegtools-config"
-      fi
-    fi
-    # Extract the first word of "mjpegtools-config", so it can be a program name with args.
-set dummy mjpegtools-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_mjpegtools_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$MJPEGTOOLS_CFLAGS"; then
+        pkg_cv_MJPEGTOOLS_CFLAGS="$MJPEGTOOLS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"mjpegtools\"") >&5
+  ($PKG_CONFIG --exists --print-errors "mjpegtools") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_MJPEGTOOLS_CFLAGS=`$PKG_CONFIG --cflags "mjpegtools" 2>/dev/null`
 else
-  case $mjpegtools_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_mjpegtools_config="$mjpegtools_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_mjpegtools_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_mjpegtools_config" && ac_cv_path_mjpegtools_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-mjpegtools_config=$ac_cv_path_mjpegtools_config
-if test -n "$mjpegtools_config"; then
-  { echo "$as_me:$LINENO: result: $mjpegtools_config" >&5
-echo "${ECHO_T}$mjpegtools_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    mjpegtools_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine MJPEGTOOLS_CFLAGS" >&5
-echo $ECHO_N "checking how to determine MJPEGTOOLS_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_mjpegtools_i" != x"" ; then
-    mjpegtools_ii="-I$w_mjpegtools_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_mjpegtools" != x"no" ; then
-      mjpegtools_ii="`$PKG_CONFIG mjpegtools --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$MJPEGTOOLS_LIBS"; then
+        pkg_cv_MJPEGTOOLS_LIBS="$MJPEGTOOLS_LIBS"
     else
-      if test x"$mjpegtools_config" != x"no" ; then
-        mjpegtools_ii="`$mjpegtools_config --cflags`"
-        { echo "$as_me:$LINENO: result: $mjpegtools_config" >&5
-echo "${ECHO_T}$mjpegtools_config" >&6; }
-      else
-        if test x"$w_mjpegtools_p" != x"" ; then
-          mjpegtools_ii="-I$w_mjpegtools_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          mjpegtools_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $mjpegtools_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  mjpegtools_ii="$ipaths"
-  mjpegtools_ii="`echo $mjpegtools_ii | sed -e 's/  */ /g'`"
-  MJPEGTOOLS_EXTRA_CFLAGS="$MJPEGTOOLS_EXTRA_CFLAGS $xi"
-  MJPEGTOOLS_EXTRA_CFLAGS="`echo $MJPEGTOOLS_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"mjpegtools/yuv4mpeg.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $mjpegtools_ii"
-    if test "${ac_cv_header_mjpegtools_yuv4mpeg_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for mjpegtools/yuv4mpeg.h" >&5
-echo $ECHO_N "checking for mjpegtools/yuv4mpeg.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mjpegtools_yuv4mpeg_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mjpegtools_yuv4mpeg_h" >&5
-echo "${ECHO_T}$ac_cv_header_mjpegtools_yuv4mpeg_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking mjpegtools/yuv4mpeg.h usability" >&5
-echo $ECHO_N "checking mjpegtools/yuv4mpeg.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <mjpegtools/yuv4mpeg.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"mjpegtools\"") >&5
+  ($PKG_CONFIG --exists --print-errors "mjpegtools") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_MJPEGTOOLS_LIBS=`$PKG_CONFIG --libs "mjpegtools" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking mjpegtools/yuv4mpeg.h presence" >&5
-echo $ECHO_N "checking mjpegtools/yuv4mpeg.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <mjpegtools/yuv4mpeg.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mjpegtools/yuv4mpeg.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: mjpegtools/yuv4mpeg.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for mjpegtools/yuv4mpeg.h" >&5
-echo $ECHO_N "checking for mjpegtools/yuv4mpeg.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mjpegtools_yuv4mpeg_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_mjpegtools_yuv4mpeg_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mjpegtools_yuv4mpeg_h" >&5
-echo "${ECHO_T}$ac_cv_header_mjpegtools_yuv4mpeg_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        MJPEGTOOLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "mjpegtools"`
+        else
+	        MJPEGTOOLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "mjpegtools"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$MJPEGTOOLS_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_mjpegtools_yuv4mpeg_h = yes; then
-  MJPEGTOOLS_CFLAGS="$mjpegtools_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"MJPEGTOOLS" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"MJPEGTOOLS" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-mjpegtools' failed"
   fi
-  msg="ERROR: $prob: cannot compile mjpegtools/yuv4mpeg.h
-mjpegtools/yuv4mpeg.h can be found in the following packages:
+  msg="ERROR: $prob:
+mjpegtools can be found in the following packages:
   mjpegtools  http://mjpeg.sourceforge.net/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_mjpegtools" != x"no" ; then
-     MJPEGTOOLS_CFLAGS="`$PKG_CONFIG mjpegtools --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine MJPEGTOOLS_LIBS" >&5
-echo $ECHO_N "checking how to determine MJPEGTOOLS_LIBS... $ECHO_C" >&6; }
-  if test x"$w_mjpegtools_l" != x"" ; then
-    mjpegtools_ll="-L$w_mjpegtools_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_mjpegtools" != x"no" ; then
-      mjpegtools_ll="`$PKG_CONFIG mjpegtools --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$mjpegtools_config" != x"no" ; then
-        mjpegtools_ll="`$mjpegtools_config --libs`"
-        { echo "$as_me:$LINENO: result: $mjpegtools_config" >&5
-echo "${ECHO_T}$mjpegtools_config" >&6; }
-      else
-        if test x"$w_mjpegtools_p" != x"" ; then
-          mjpegtools_ll="-L$w_mjpegtools_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          mjpegtools_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $mjpegtools_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lmjpegutils" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  mjpegtools_ll="$lpaths"
-  mjpegtools_ll="`echo $mjpegtools_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $MJPEGTOOLS_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  MJPEGTOOLS_EXTRA_LIBS="$MJPEGTOOLS_EXTRA_LIBS $xl"
-  MJPEGTOOLS_EXTRA_LIBS="`echo $MJPEGTOOLS_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"mjpegutils" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $mjpegtools_ll"
-    { echo "$as_me:$LINENO: checking for y4m_si_get_height in -lmjpegutils" >&5
-echo $ECHO_N "checking for y4m_si_get_height in -lmjpegutils... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mjpegutils_y4m_si_get_height+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmjpegutils $MJPEGTOOLS_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char y4m_si_get_height ();
-int
-main ()
-{
-return y4m_si_get_height ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_mjpegutils_y4m_si_get_height=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_mjpegutils_y4m_si_get_height=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mjpegutils_y4m_si_get_height" >&5
-echo "${ECHO_T}$ac_cv_lib_mjpegutils_y4m_si_get_height" >&6; }
-if test $ac_cv_lib_mjpegutils_y4m_si_get_height = yes; then
-  MJPEGTOOLS_LIBS="$mjpegtools_ll -lmjpegutils $MJPEGTOOLS_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"MJPEGTOOLS" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"MJPEGTOOLS" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-mjpegtools' failed"
   fi
-  msg="ERROR: $prob: cannot link against libmjpegutils
-libmjpegutils can be found in the following packages:
+  msg="ERROR: $prob:
+mjpegtools can be found in the following packages:
   mjpegtools  http://mjpeg.sourceforge.net/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	MJPEGTOOLS_CFLAGS=$pkg_cv_MJPEGTOOLS_CFLAGS
+	MJPEGTOOLS_LIBS=$pkg_cv_MJPEGTOOLS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_mjpegtools="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_mjpegtools" != x"no" ; then
-     MJPEGTOOLS_LIBS="`$PKG_CONFIG mjpegtools --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_mjpegtools="yes"
-  fi
-
 else
   MJPEGTOOLS_CFLAGS=""
   MJPEGTOOLS_LIBS=""
@@ -38676,448 +35156,117 @@ fi
 echo "${ECHO_T}$enable_sdl" >&6; }
 fi
 
-
-# Check whether --with-sdl-prefix was given.
-if test "${with_sdl_prefix+set}" = set; then
-  withval=$with_sdl_prefix; w_sdl_p="$withval"
-else
-  w_sdl_p=""
-fi
-
-
-
-# Check whether --with-sdl-includes was given.
-if test "${with_sdl_includes+set}" = set; then
-  withval=$with_sdl_includes; w_sdl_i="$withval"
-else
-  w_sdl_i=""
-fi
-
-
-
-# Check whether --with-sdl-libs was given.
-if test "${with_sdl_libs+set}" = set; then
-  withval=$with_sdl_libs; w_sdl_l="$withval"
-else
-  w_sdl_l=""
-fi
-
-
 have_sdl="no"
 this_pkg_err="no"
 
 if test x"$enable_sdl" = x"yes" ; then
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for SDL" >&5
+echo $ECHO_N "checking for SDL... $ECHO_C" >&6; }
 
-  pkg_config_sdl="no"
-  { echo "$as_me:$LINENO: checking for pkgconfig support for sdl" >&5
-echo $ECHO_N "checking for pkgconfig support for sdl... $ECHO_C" >&6; }
-  if test x"$PKG_CONFIG" != x"no" ; then
-    if $PKG_CONFIG SDL --exists ; then
-      pkg_config_sdl="yes"
-    fi
-  fi
-  { echo "$as_me:$LINENO: result: $pkg_config_sdl" >&5
-echo "${ECHO_T}$pkg_config_sdl" >&6; }
-
-
-  if test x"sdl-config" != x"no" ; then
-    if test x"$w_sdl_p" != x"" ; then
-      if test -x $w_sdl_p/bin/sdl-config ; then
-        sdl_config="$w_sdl_p/bin/sdl-config"
-      fi
-    fi
-    # Extract the first word of "sdl-config", so it can be a program name with args.
-set dummy sdl-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_sdl_config+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$PKG_CONFIG"; then
+    if test -n "$SDL_CFLAGS"; then
+        pkg_cv_SDL_CFLAGS="$SDL_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl\"") >&5
+  ($PKG_CONFIG --exists --print-errors "sdl") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null`
 else
-  case $sdl_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_sdl_config="$sdl_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_sdl_config="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_sdl_config" && ac_cv_path_sdl_config="no"
-  ;;
-esac
+  pkg_failed=yes
 fi
-sdl_config=$ac_cv_path_sdl_config
-if test -n "$sdl_config"; then
-  { echo "$as_me:$LINENO: result: $sdl_config" >&5
-echo "${ECHO_T}$sdl_config" >&6; }
+    fi
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	pkg_failed=untried
 fi
-
-
-  else
-    sdl_config="no"
-  fi
-
-  # get and test the _CFLAGS
-
-  { echo "$as_me:$LINENO: checking how to determine SDL_CFLAGS" >&5
-echo $ECHO_N "checking how to determine SDL_CFLAGS... $ECHO_C" >&6; }
-  if test x"$w_sdl_i" != x"" ; then
-    sdl_ii="-I$w_sdl_i"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_sdl" != x"no" ; then
-      sdl_ii="`$PKG_CONFIG SDL --cflags`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
+if test -n "$PKG_CONFIG"; then
+    if test -n "$SDL_LIBS"; then
+        pkg_cv_SDL_LIBS="$SDL_LIBS"
     else
-      if test x"$sdl_config" != x"no" ; then
-        sdl_ii="`$sdl_config --cflags`"
-        { echo "$as_me:$LINENO: result: $sdl_config" >&5
-echo "${ECHO_T}$sdl_config" >&6; }
-      else
-        if test x"$w_sdl_p" != x"" ; then
-          sdl_ii="-I$w_sdl_p/include"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          sdl_ii="-I/usr/include"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  ipaths="" ; xi=""
-  for i in $sdl_ii ; do
-    case $i in
-      -I*) ipaths="$ipaths $i" ;;
-        *) xi="$xi $i" ;;
-    esac
-  done
-  sdl_ii="$ipaths"
-  sdl_ii="`echo $sdl_ii | sed -e 's/  */ /g'`"
-  SDL_EXTRA_CFLAGS="$SDL_EXTRA_CFLAGS $xi"
-  SDL_EXTRA_CFLAGS="`echo $SDL_EXTRA_CFLAGS | sed -e 's/  */ /g'`"
-
-  if test x"SDL.h" != x"none" ; then
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $sdl_ii"
-    if test "${ac_cv_header_SDL_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for SDL.h" >&5
-echo $ECHO_N "checking for SDL.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_SDL_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_SDL_h" >&5
-echo "${ECHO_T}$ac_cv_header_SDL_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking SDL.h usability" >&5
-echo $ECHO_N "checking SDL.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <SDL.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl\"") >&5
+  ($PKG_CONFIG --exists --print-errors "sdl") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  (exit $ac_status); }; then
+  pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null`
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
+  pkg_failed=yes
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking SDL.h presence" >&5
-echo $ECHO_N "checking SDL.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <SDL.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+    fi
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+	pkg_failed=untried
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: SDL.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: SDL.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: SDL.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: SDL.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: SDL.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: SDL.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: SDL.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: SDL.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: SDL.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: SDL.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: SDL.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: SDL.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: SDL.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: SDL.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: SDL.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: SDL.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for SDL.h" >&5
-echo $ECHO_N "checking for SDL.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_SDL_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_SDL_h=$ac_header_preproc
+        _pkg_short_errors_supported=no
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_SDL_h" >&5
-echo "${ECHO_T}$ac_cv_header_SDL_h" >&6; }
+        if test $_pkg_short_errors_supported = yes; then
+	        SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl"`
+        else
+	        SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$SDL_PKG_ERRORS" >&5
 
-fi
-if test $ac_cv_header_SDL_h = yes; then
-  SDL_CFLAGS="$sdl_ii"
-else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"SDL" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"SDL" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-sdl' failed"
   fi
-  msg="ERROR: $prob: cannot compile SDL.h
-SDL.h can be found in the following packages:
-  SDL  http://www.libsdl.org/
+  msg="ERROR: $prob:
+sdl can be found in the following packages:
+  sdl  http://www.libsdl.org/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
-fi
-
-
-    CPPFLAGS="$save_CPPFLAGS"
-  elif test x"$pkg_config_sdl" != x"no" ; then
-     SDL_CFLAGS="`$PKG_CONFIG SDL --cflags`"
-  fi
-
-  # get and test the _LIBS
-
-  { echo "$as_me:$LINENO: checking how to determine SDL_LIBS" >&5
-echo $ECHO_N "checking how to determine SDL_LIBS... $ECHO_C" >&6; }
-  if test x"$w_sdl_l" != x"" ; then
-    sdl_ll="-L$w_sdl_l"
-    { echo "$as_me:$LINENO: result: user" >&5
-echo "${ECHO_T}user" >&6; }
-  else
-    if test x"$pkg_config_sdl" != x"no" ; then
-      sdl_ll="`$PKG_CONFIG SDL --libs`"
-      { echo "$as_me:$LINENO: result: pkg-config" >&5
-echo "${ECHO_T}pkg-config" >&6; }
-    else
-      if test x"$sdl_config" != x"no" ; then
-        sdl_ll="`$sdl_config --libs`"
-        { echo "$as_me:$LINENO: result: $sdl_config" >&5
-echo "${ECHO_T}$sdl_config" >&6; }
-      else
-        if test x"$w_sdl_p" != x"" ; then
-          sdl_ll="-L$w_sdl_p${deflib}"
-          { echo "$as_me:$LINENO: result: prefix" >&5
-echo "${ECHO_T}prefix" >&6; }
-        else
-          sdl_ll="-L/usr${deflib}"
-          { echo "$as_me:$LINENO: result: default" >&5
-echo "${ECHO_T}default" >&6; }
-        fi
-      fi
-    fi
-  fi
-  lpaths="" ; xlibs="" ; xlf=""
-  for l in $sdl_ll ; do
-    case $l in
-      -L*) lpaths="$lpaths $l" ;;
-      -l*) test x"$l" != x"-lSDL" && xlibs="$xlibs $l" ;;
-        *) xlf="$xlf $l" ;;
-    esac
-  done
-  sdl_ll="$lpaths"
-  sdl_ll="`echo $sdl_ll | sed -e 's/  */ /g'`"
-  xl=""
-  for i in $xlibs $xlf ; do
-    echo " $SDL_EXTRA_LIBS " | grep -vq " $i " && xl="$xl $i"
-  done
-  SDL_EXTRA_LIBS="$SDL_EXTRA_LIBS $xl"
-  SDL_EXTRA_LIBS="`echo $SDL_EXTRA_LIBS | sed -e 's/  */ /g'`"
-
-  if test x"SDL" != x"none" ; then
-    save_LDFLAGS="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $sdl_ll"
-    { echo "$as_me:$LINENO: checking for SDL_Init in -lSDL" >&5
-echo $ECHO_N "checking for SDL_Init in -lSDL... $ECHO_C" >&6; }
-if test "${ac_cv_lib_SDL_SDL_Init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSDL $SDL_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char SDL_Init ();
-int
-main ()
-{
-return SDL_Init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_SDL_SDL_Init=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_SDL_SDL_Init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_SDL_Init" >&5
-echo "${ECHO_T}$ac_cv_lib_SDL_SDL_Init" >&6; }
-if test $ac_cv_lib_SDL_SDL_Init = yes; then
-  SDL_LIBS="$sdl_ll -lSDL $SDL_EXTRA_LIBS"
-else
+elif test $pkg_failed = untried; then
 
 this_pkg_err="yes"
-if test x"no" != x"optional" ; then
+if test x"SDL" != x"optional" ; then
   tc_pkg_err="yes"
 
   prob=""
-  if test x"no" = x"required" ; then
+  if test x"SDL" = x"required" ; then
     prob="requirement failed"
   else
     prob="option '--enable-sdl' failed"
   fi
-  msg="ERROR: $prob: cannot link against libSDL
-libSDL can be found in the following packages:
-  SDL  http://www.libsdl.org/
+  msg="ERROR: $prob:
+sdl can be found in the following packages:
+  sdl  http://www.libsdl.org/
 
 "
   tc_pkg_err_text="$tc_pkg_err_text$msg"
 fi
 
+else
+	SDL_CFLAGS=$pkg_cv_SDL_CFLAGS
+	SDL_LIBS=$pkg_cv_SDL_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_sdl="yes"
 fi
-
-    LDFLAGS="$save_LDFLAGS"
-  elif test x"$pkg_config_sdl" != x"no" ; then
-     SDL_LIBS="`$PKG_CONFIG SDL --libs`"
-  fi
-
-  if test x"$this_pkg_err" = x"no" ; then
-    have_sdl="yes"
-  fi
-
 else
   SDL_CFLAGS=""
   SDL_LIBS=""
@@ -39125,8 +35274,8 @@ fi
 
 if test x"$have_sdl" = x"yes" ; then
   sdl_major_version=1
-  sdl_minor_version=1
-  sdl_micro_version=6
+  sdl_minor_version=2
+  sdl_micro_version=5
   save_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
   if test "$cross_compiling" = yes; then
@@ -42632,6 +38781,20 @@ echo "$as_me: error: conditional \"HAVE_FFMPEG\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_LIBV4L2_TRUE}" && test -z "${HAVE_LIBV4L2_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBV4L2\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_LIBV4L2\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_LIBV4LCONVERT_TRUE}" && test -z "${HAVE_LIBV4LCONVERT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBV4LCONVERT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_LIBV4LCONVERT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${HAVE_LIBMPEG2_TRUE}" && test -z "${HAVE_LIBMPEG2_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBMPEG2\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -42639,6 +38802,13 @@ echo "$as_me: error: conditional \"HAVE_LIBMPEG2\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_LIBMPEG2CONVERT_TRUE}" && test -z "${HAVE_LIBMPEG2CONVERT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBMPEG2CONVERT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_LIBMPEG2CONVERT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${ENABLE_EXPERIMENTAL_TRUE}" && test -z "${ENABLE_EXPERIMENTAL_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"ENABLE_EXPERIMENTAL\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -43163,7 +39333,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by transcode $as_me 1.1.3, which was
+This file was extended by transcode $as_me 1.1.5, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -43216,7 +39386,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-transcode config.status 1.1.3
+transcode config.status 1.1.5
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -43653,17 +39823,17 @@ LIBAVFORMAT_CFLAGS!$LIBAVFORMAT_CFLAGS$ac_delim
 LIBAVFORMAT_LIBS!$LIBAVFORMAT_LIBS$ac_delim
 HAVE_FFMPEG_TRUE!$HAVE_FFMPEG_TRUE$ac_delim
 HAVE_FFMPEG_FALSE!$HAVE_FFMPEG_FALSE$ac_delim
-libmpeg2_config!$libmpeg2_config$ac_delim
-HAVE_LIBMPEG2_TRUE!$HAVE_LIBMPEG2_TRUE$ac_delim
-HAVE_LIBMPEG2_FALSE!$HAVE_LIBMPEG2_FALSE$ac_delim
+LIBV4L2_CFLAGS!$LIBV4L2_CFLAGS$ac_delim
+LIBV4L2_LIBS!$LIBV4L2_LIBS$ac_delim
+LIBV4LCONVERT_CFLAGS!$LIBV4LCONVERT_CFLAGS$ac_delim
+LIBV4LCONVERT_LIBS!$LIBV4LCONVERT_LIBS$ac_delim
+HAVE_LIBV4L2_TRUE!$HAVE_LIBV4L2_TRUE$ac_delim
+HAVE_LIBV4L2_FALSE!$HAVE_LIBV4L2_FALSE$ac_delim
+HAVE_LIBV4LCONVERT_TRUE!$HAVE_LIBV4LCONVERT_TRUE$ac_delim
+HAVE_LIBV4LCONVERT_FALSE!$HAVE_LIBV4LCONVERT_FALSE$ac_delim
 LIBMPEG2_CFLAGS!$LIBMPEG2_CFLAGS$ac_delim
 LIBMPEG2_LIBS!$LIBMPEG2_LIBS$ac_delim
-ENABLE_EXPERIMENTAL_TRUE!$ENABLE_EXPERIMENTAL_TRUE$ac_delim
-ENABLE_EXPERIMENTAL_FALSE!$ENABLE_EXPERIMENTAL_FALSE$ac_delim
-ENABLE_DEPRECATED_TRUE!$ENABLE_DEPRECATED_TRUE$ac_delim
-ENABLE_DEPRECATED_FALSE!$ENABLE_DEPRECATED_FALSE$ac_delim
-HAVE_V4L_TRUE!$HAVE_V4L_TRUE$ac_delim
-HAVE_V4L_FALSE!$HAVE_V4L_FALSE$ac_delim
+LIBMPEG2CONVERT_CFLAGS!$LIBMPEG2CONVERT_CFLAGS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -43705,6 +39875,17 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+LIBMPEG2CONVERT_LIBS!$LIBMPEG2CONVERT_LIBS$ac_delim
+HAVE_LIBMPEG2_TRUE!$HAVE_LIBMPEG2_TRUE$ac_delim
+HAVE_LIBMPEG2_FALSE!$HAVE_LIBMPEG2_FALSE$ac_delim
+HAVE_LIBMPEG2CONVERT_TRUE!$HAVE_LIBMPEG2CONVERT_TRUE$ac_delim
+HAVE_LIBMPEG2CONVERT_FALSE!$HAVE_LIBMPEG2CONVERT_FALSE$ac_delim
+ENABLE_EXPERIMENTAL_TRUE!$ENABLE_EXPERIMENTAL_TRUE$ac_delim
+ENABLE_EXPERIMENTAL_FALSE!$ENABLE_EXPERIMENTAL_FALSE$ac_delim
+ENABLE_DEPRECATED_TRUE!$ENABLE_DEPRECATED_TRUE$ac_delim
+ENABLE_DEPRECATED_FALSE!$ENABLE_DEPRECATED_FALSE$ac_delim
+HAVE_V4L_TRUE!$HAVE_V4L_TRUE$ac_delim
+HAVE_V4L_FALSE!$HAVE_V4L_FALSE$ac_delim
 HAVE_BKTR_TRUE!$HAVE_BKTR_TRUE$ac_delim
 HAVE_BKTR_FALSE!$HAVE_BKTR_FALSE$ac_delim
 HAVE_SUNAU_TRUE!$HAVE_SUNAU_TRUE$ac_delim
@@ -43713,16 +39894,14 @@ HAVE_OSS_TRUE!$HAVE_OSS_TRUE$ac_delim
 HAVE_OSS_FALSE!$HAVE_OSS_FALSE$ac_delim
 HAVE_ALSA_TRUE!$HAVE_ALSA_TRUE$ac_delim
 HAVE_ALSA_FALSE!$HAVE_ALSA_FALSE$ac_delim
-libpostproc_config!$libpostproc_config$ac_delim
-HAVE_LIBPOSTPROC_TRUE!$HAVE_LIBPOSTPROC_TRUE$ac_delim
-HAVE_LIBPOSTPROC_FALSE!$HAVE_LIBPOSTPROC_FALSE$ac_delim
 LIBPOSTPROC_CFLAGS!$LIBPOSTPROC_CFLAGS$ac_delim
 LIBPOSTPROC_LIBS!$LIBPOSTPROC_LIBS$ac_delim
-freetype2_config!$freetype2_config$ac_delim
-HAVE_FREETYPE2_TRUE!$HAVE_FREETYPE2_TRUE$ac_delim
-HAVE_FREETYPE2_FALSE!$HAVE_FREETYPE2_FALSE$ac_delim
+HAVE_LIBPOSTPROC_TRUE!$HAVE_LIBPOSTPROC_TRUE$ac_delim
+HAVE_LIBPOSTPROC_FALSE!$HAVE_LIBPOSTPROC_FALSE$ac_delim
 FREETYPE2_CFLAGS!$FREETYPE2_CFLAGS$ac_delim
 FREETYPE2_LIBS!$FREETYPE2_LIBS$ac_delim
+HAVE_FREETYPE2_TRUE!$HAVE_FREETYPE2_TRUE$ac_delim
+HAVE_FREETYPE2_FALSE!$HAVE_FREETYPE2_FALSE$ac_delim
 lame_config!$lame_config$ac_delim
 HAVE_LAME_TRUE!$HAVE_LAME_TRUE$ac_delim
 HAVE_LAME_FALSE!$HAVE_LAME_FALSE$ac_delim
@@ -43733,26 +39912,22 @@ HAVE_XVID_TRUE!$HAVE_XVID_TRUE$ac_delim
 HAVE_XVID_FALSE!$HAVE_XVID_FALSE$ac_delim
 XVID_CFLAGS!$XVID_CFLAGS$ac_delim
 XVID_LIBS!$XVID_LIBS$ac_delim
-x264_config!$x264_config$ac_delim
-HAVE_X264_TRUE!$HAVE_X264_TRUE$ac_delim
-HAVE_X264_FALSE!$HAVE_X264_FALSE$ac_delim
 X264_CFLAGS!$X264_CFLAGS$ac_delim
 X264_LIBS!$X264_LIBS$ac_delim
-ogg_config!$ogg_config$ac_delim
-HAVE_OGG_TRUE!$HAVE_OGG_TRUE$ac_delim
-HAVE_OGG_FALSE!$HAVE_OGG_FALSE$ac_delim
+HAVE_X264_TRUE!$HAVE_X264_TRUE$ac_delim
+HAVE_X264_FALSE!$HAVE_X264_FALSE$ac_delim
 OGG_CFLAGS!$OGG_CFLAGS$ac_delim
 OGG_LIBS!$OGG_LIBS$ac_delim
-vorbis_config!$vorbis_config$ac_delim
-HAVE_VORBIS_TRUE!$HAVE_VORBIS_TRUE$ac_delim
-HAVE_VORBIS_FALSE!$HAVE_VORBIS_FALSE$ac_delim
+HAVE_OGG_TRUE!$HAVE_OGG_TRUE$ac_delim
+HAVE_OGG_FALSE!$HAVE_OGG_FALSE$ac_delim
 VORBIS_CFLAGS!$VORBIS_CFLAGS$ac_delim
 VORBIS_LIBS!$VORBIS_LIBS$ac_delim
-theora_config!$theora_config$ac_delim
-HAVE_THEORA_TRUE!$HAVE_THEORA_TRUE$ac_delim
-HAVE_THEORA_FALSE!$HAVE_THEORA_FALSE$ac_delim
+HAVE_VORBIS_TRUE!$HAVE_VORBIS_TRUE$ac_delim
+HAVE_VORBIS_FALSE!$HAVE_VORBIS_FALSE$ac_delim
 THEORA_CFLAGS!$THEORA_CFLAGS$ac_delim
 THEORA_LIBS!$THEORA_LIBS$ac_delim
+HAVE_THEORA_TRUE!$HAVE_THEORA_TRUE$ac_delim
+HAVE_THEORA_FALSE!$HAVE_THEORA_FALSE$ac_delim
 libdvdread_config!$libdvdread_config$ac_delim
 HAVE_LIBDVDREAD_TRUE!$HAVE_LIBDVDREAD_TRUE$ac_delim
 HAVE_LIBDVDREAD_FALSE!$HAVE_LIBDVDREAD_FALSE$ac_delim
@@ -43764,16 +39939,14 @@ HAVE_PVM3_TRUE!$HAVE_PVM3_TRUE$ac_delim
 HAVE_PVM3_FALSE!$HAVE_PVM3_FALSE$ac_delim
 PVM3_CFLAGS!$PVM3_CFLAGS$ac_delim
 PVM3_LIBS!$PVM3_LIBS$ac_delim
-libdv_config!$libdv_config$ac_delim
-HAVE_LIBDV_TRUE!$HAVE_LIBDV_TRUE$ac_delim
-HAVE_LIBDV_FALSE!$HAVE_LIBDV_FALSE$ac_delim
 LIBDV_CFLAGS!$LIBDV_CFLAGS$ac_delim
 LIBDV_LIBS!$LIBDV_LIBS$ac_delim
-libquicktime_config!$libquicktime_config$ac_delim
-HAVE_LIBQUICKTIME_TRUE!$HAVE_LIBQUICKTIME_TRUE$ac_delim
-HAVE_LIBQUICKTIME_FALSE!$HAVE_LIBQUICKTIME_FALSE$ac_delim
+HAVE_LIBDV_TRUE!$HAVE_LIBDV_TRUE$ac_delim
+HAVE_LIBDV_FALSE!$HAVE_LIBDV_FALSE$ac_delim
 LIBQUICKTIME_CFLAGS!$LIBQUICKTIME_CFLAGS$ac_delim
 LIBQUICKTIME_LIBS!$LIBQUICKTIME_LIBS$ac_delim
+HAVE_LIBQUICKTIME_TRUE!$HAVE_LIBQUICKTIME_TRUE$ac_delim
+HAVE_LIBQUICKTIME_FALSE!$HAVE_LIBQUICKTIME_FALSE$ac_delim
 lzo_config!$lzo_config$ac_delim
 HAVE_LZO_TRUE!$HAVE_LZO_TRUE$ac_delim
 HAVE_LZO_FALSE!$HAVE_LZO_FALSE$ac_delim
@@ -43789,19 +39962,16 @@ HAVE_FAAC_TRUE!$HAVE_FAAC_TRUE$ac_delim
 HAVE_FAAC_FALSE!$HAVE_FAAC_FALSE$ac_delim
 FAAC_CFLAGS!$FAAC_CFLAGS$ac_delim
 FAAC_LIBS!$FAAC_LIBS$ac_delim
-libxml2_config!$libxml2_config$ac_delim
-HAVE_LIBXML2_TRUE!$HAVE_LIBXML2_TRUE$ac_delim
-HAVE_LIBXML2_FALSE!$HAVE_LIBXML2_FALSE$ac_delim
 LIBXML2_CFLAGS!$LIBXML2_CFLAGS$ac_delim
 LIBXML2_LIBS!$LIBXML2_LIBS$ac_delim
+HAVE_LIBXML2_TRUE!$HAVE_LIBXML2_TRUE$ac_delim
+HAVE_LIBXML2_FALSE!$HAVE_LIBXML2_FALSE$ac_delim
 IBP_LIBS!$IBP_LIBS$ac_delim
 HAVE_IBP_TRUE!$HAVE_IBP_TRUE$ac_delim
 HAVE_IBP_FALSE!$HAVE_IBP_FALSE$ac_delim
 XIO_CFLAGS!$XIO_CFLAGS$ac_delim
 XIO_LIBS!$XIO_LIBS$ac_delim
-mjpegtools_config!$mjpegtools_config$ac_delim
-HAVE_MJPEGTOOLS_TRUE!$HAVE_MJPEGTOOLS_TRUE$ac_delim
-HAVE_MJPEGTOOLS_FALSE!$HAVE_MJPEGTOOLS_FALSE$ac_delim
+MJPEGTOOLS_CFLAGS!$MJPEGTOOLS_CFLAGS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -43843,13 +40013,13 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
-MJPEGTOOLS_CFLAGS!$MJPEGTOOLS_CFLAGS$ac_delim
 MJPEGTOOLS_LIBS!$MJPEGTOOLS_LIBS$ac_delim
-sdl_config!$sdl_config$ac_delim
-HAVE_SDL_TRUE!$HAVE_SDL_TRUE$ac_delim
-HAVE_SDL_FALSE!$HAVE_SDL_FALSE$ac_delim
+HAVE_MJPEGTOOLS_TRUE!$HAVE_MJPEGTOOLS_TRUE$ac_delim
+HAVE_MJPEGTOOLS_FALSE!$HAVE_MJPEGTOOLS_FALSE$ac_delim
 SDL_CFLAGS!$SDL_CFLAGS$ac_delim
 SDL_LIBS!$SDL_LIBS$ac_delim
+HAVE_SDL_TRUE!$HAVE_SDL_TRUE$ac_delim
+HAVE_SDL_FALSE!$HAVE_SDL_FALSE$ac_delim
 imagemagick_config!$imagemagick_config$ac_delim
 HAVE_IMAGEMAGICK_TRUE!$HAVE_IMAGEMAGICK_TRUE$ac_delim
 HAVE_IMAGEMAGICK_FALSE!$HAVE_IMAGEMAGICK_FALSE$ac_delim
diff --git a/configure.in b/configure.in
index 1260393..7bfccd2 100644
--- a/configure.in
+++ b/configure.in
@@ -1,13 +1,13 @@
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT(transcode,1.1.3)
+AC_INIT(transcode,1.1.5)
 AC_CONFIG_AUX_DIR(autotools)
 AC_CONFIG_SRCDIR(src/transcode.c)
 
 dnl Detect the canonical host and target build environment
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(transcode,1.1.3)
+AM_INIT_AUTOMAKE(transcode,1.1.5)
 AM_CONFIG_HEADER(config.h)
 
 AM_MAINTAINER_MODE
@@ -146,9 +146,9 @@ AM_CONDITIONAL(HAVE_GETTIMEOFDAY, test x"$ac_cv_func_gettimeofday" = x"yes")
 
 dnl Special check for sysconf() to ensure _SC_PAGESIZE is also available.
 AC_CACHE_CHECK([for sysconf(_SC_PAGESIZE)], ac_cv_sysconf_with_sc_pagesize,
-    [AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <unistd.h>], [sysconf(_SC_PAGESIZE)])],
-        [ac_cv_sysconf_with_sc_pagesize=yes],
-        [ac_cv_sysconf_with_sc_pagesize=no])])
+               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],[[sysconf(_SC_PAGESIZE);]])],
+                                  [ac_cv_sysconf_with_sc_pagesize=yes],
+                                  [ac_cv_sysconf_with_sc_pagesize=no])])
 if test x"$ac_cv_sysconf_with_sc_pagesize" = x"yes"; then
     AC_DEFINE([HAVE_SYSCONF_WITH_SC_PAGESIZE], 1,
               [Define to 1 if you have sysconf(_SC_PAGESIZE).])
@@ -491,6 +491,7 @@ dnl ---------------------------------------------------------------------
 dnl
 dnl pkgconfig
 dnl
+PKG_PROG_PKG_CONFIG([0.20])
 if test -z "$PKG_CONFIG" ; then
   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 fi
@@ -587,6 +588,7 @@ if test x"$enable_ffmpeg" = x"no" ; then
   AC_MSG_RESULT(disabled)
 else
   AC_MSG_RESULT(requested, checking for libraries)
+
   dnl
   dnl libavcodec
   dnl
@@ -632,19 +634,10 @@ else
   dnl
   dnl libavformat
   dnl
-  ffmpeg_lavf_inc="ffmpeg"
   LIBAVFORMAT_EXTRA_LIBS="$LIBAVFORMAT_EXTRA_LIBS $($PKG_CONFIG --libs libavformat)"
   TC_PKG_CHECK(libavformat, optional, LIBAVFORMAT, no, [libavformat/avformat.h],
    avformat, av_register_all, libavformat, [http://www.ffmpeg.org/])
   if test x"$have_libavformat" = x"yes" ; then
-    ffmpeg_headers_layout="new"
-    ffmpeg_lavf_inc="libavformat"
-  else
-  # second try, old include path
-    TC_PKG_CHECK(libavformat, required, LIBAVFORMAT, no, [ffmpeg/avformat.h],
-     avformat, av_register_all, libavformat, [http://www.ffmpeg.org/])
-  fi
-  if test x"$have_libavformat" = x"yes" ; then
     save_CPPFLAGS="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS $LIBAVFORMAT_CFLAGS"
     AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -693,15 +686,26 @@ dnl
 dnl setup layout define once
 dnl
 
+dnl
+dnl libv4l toolkit
+dnl
+TC_PKG_CONFIG_CHECK(libv4l2, no, LIBV4L2, libv4l2,
+                    [http://hansdegoede.livejournal.com/3636.html])
+TC_PKG_CONFIG_CHECK(libv4lconvert, no, LIBV4LCONVERT,
+                    libv4lconvert,
+                    [http://hansdegoede.livejournal.com/3636.html])
+TC_PKG_HAVE(libv4l2, LIBV4L2)
+TC_PKG_HAVE(libv4lconvert, LIBV4LCONVERT)
 
 dnl
 dnl libmpeg2
 dnl
-LIBMPEG2_EXTRA_LIBS="$LIBMPEG2_EXTRA_LIBS $($PKG_CONFIG --libs libmpeg2) $($PKG_CONFIG --libs libmpeg2convert)"
-TC_PKG_CHECK(libmpeg2, required, LIBMPEG2, no, mpeg2dec/mpeg2.h,
-  mpeg2, mpeg2_init, mpeg2dec, [http://libmpeg2.sourceforge.net/])
+TC_PKG_CONFIG_CHECK(libmpeg2, no, LIBMPEG2, libmpeg2,
+                    [http://libmpeg2.sf.net/])
+TC_PKG_CONFIG_CHECK(libmpeg2convert, no, LIBMPEG2CONVERT,
+                    libmpeg2convert, [http://libmpeg2.sf.net/])
 TC_PKG_HAVE(libmpeg2, LIBMPEG2)
-
+TC_PKG_HAVE(libmpeg2convert, LIBMPEG2CONVERT)
 
 dnl
 dnl build options
@@ -810,16 +814,13 @@ AC_CHECK_HEADERS([encore2.h])
 dnl
 dnl libpostproc
 dnl
-LIBPOSTPROC_EXTRA_LIBS="$LIBPOSTPROC_EXTRA_LIBS $($PKG_CONFIG --libs libpostproc)"
-TC_PKG_CHECK(libpostproc, no, LIBPOSTPROC, no, [libpostproc/postprocess.h],
-  postproc, pp_postprocess, libpostproc, [http://www.ffmpeg.org/])
+TC_PKG_CONFIG_CHECK(libpostproc, no, LIBPOSTPROC, libpostproc, [http://ffmpeg.mplayerhq.hu/])
 TC_PKG_HAVE(libpostproc, LIBPOSTPROC)
 
 dnl
 dnl freetype2
 dnl
-TC_PKG_CHECK(freetype2, no, FREETYPE2, freetype-config, ft2build.h,
-  freetype, FT_Init_FreeType, freetype, [http://www.freetype.org/])
+TC_PKG_CONFIG_CHECK(freetype2, no, FREETYPE2, freetype2, [http://www.freetype.org/])
 TC_PKG_HAVE(freetype2, FREETYPE2)
 
 dnl
@@ -918,8 +919,7 @@ TC_PKG_HAVE(xvid, XVID)
 dnl
 dnl x264
 dnl
-TC_PKG_CHECK(x264, no, X264, no, [x264.h], x264, x264_param_default, x264,
- [http://developers.videolan.org/x264.html])
+TC_PKG_CONFIG_CHECK(x264, no, X264, x264, [http://developers.videolan.org/x264.html])
 if test x"$have_x264" = x"yes" ; then
   AC_MSG_CHECKING([x264 version])
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -951,24 +951,19 @@ TC_PKG_HAVE(x264, X264)
 dnl
 dnl ogg
 dnl
-TC_PKG_CHECK(ogg, no, OGG, no, [ogg/ogg.h], ogg, ogg_stream_init, ogg,
- [http://www.xiph.org/ogg/])
+TC_PKG_CONFIG_CHECK(ogg, no, OGG, ogg, [http://www.xiph.org/ogg/])
 TC_PKG_HAVE(ogg, OGG)
 
 dnl
 dnl vorbis
 dnl
-VORBIS_EXTRA_LIBS="$VORBIS_EXTRA_LIBS $($PKG_CONFIG --libs vorbis)"
-TC_PKG_CHECK(vorbis, no, VORBIS, no, [vorbis/codec.h], vorbis,
- vorbis_info_init, vorbis, [http://www.xiph.org/ogg/vorbis/])
+TC_PKG_CONFIG_CHECK(vorbis, no, VORBIS, vorbis, [http://www.xiph.org/ogg/vorbis/])
 TC_PKG_HAVE(vorbis, VORBIS)
 
 dnl
 dnl theora
 dnl
-THEORA_EXTRA_LIBS="$THEORA_EXTRA_LIBS $($PKG_CONFIG --libs theora)"
-TC_PKG_CHECK(theora, no, THEORA, no, [theora/theora.h], theora,
- theora_info_init, theora, [http://www.theora.org/])
+TC_PKG_CONFIG_CHECK(theora, no, THEORA, theora, [http://www.theora.org/])
 TC_PKG_HAVE(theora, THEORA)
 
 dnl
@@ -1043,17 +1038,13 @@ TC_PKG_HAVE(pvm3, PVM3)
 dnl
 dnl libdv
 dnl
-LIBDV_EXTRA_LIBS="$LIBDV_EXTRA_LIBS $($PKG_CONFIG --libs libdv)"
-TC_PKG_CHECK(libdv, no, LIBDV, no, [libdv/dv.h], dv, dv_encoder_new,
- libdv, [http://libdv.sourceforge.net/])
+TC_PKG_CONFIG_CHECK(libdv, no, LIBDV, libdv, [http://libdv.sourceforge.net/])
 TC_PKG_HAVE(libdv, LIBDV)
 
 dnl
 dnl libquicktime
 dnl
-LIBQUICKTIME_EXTRA_LIBS="$LIBQUICKTIME_EXTRA_LIBS $($PKG_CONFIG --libs libquicktime)"
-TC_PKG_CHECK(libquicktime, no, LIBQUICKTIME, no, [quicktime.h],
- quicktime, quicktime_open, libquicktime,
+TC_PKG_CONFIG_CHECK(libquicktime, no, LIBQUICKTIME, libquicktime,
  [http://libquicktime.sourceforge.net/])
 if test x"$have_libquicktime" = x"yes" ; then
   AC_CHECK_LIB(quicktime, lqt_encode_video,
@@ -1093,9 +1084,7 @@ TC_PKG_HAVE(faac, FAAC)
 dnl
 dnl libxml2
 dnl
-LIBXML2_EXTRA_LIBS="$LIBXML2_EXTRA_LIBS $($PKG_CONFIG --libs libxml-2.0)"
-TC_PKG_CHECK(libxml2, no, LIBXML2, xml2-config, [libxml/parser.h],
- xml2, xmlStrcmp, libxml-2.0, [http://xmlsoft.org])
+TC_PKG_CONFIG_CHECK(libxml2, no, LIBXML2, libxml-2.0, [http://xmlsoft.org])
 TC_PKG_HAVE(libxml2, LIBXML2)
 
 dnl
@@ -1116,8 +1105,7 @@ AC_SUBST(XIO_LIBS)
 dnl
 dnl mjpegtools (actually only YUV4MPEG)
 dnl
-TC_PKG_CHECK(mjpegtools, no, MJPEGTOOLS, mjpegtools-config,
- [mjpegtools/yuv4mpeg.h], mjpegutils, y4m_si_get_height, mjpegtools,
+TC_PKG_CONFIG_CHECK(mjpegtools, no, MJPEGTOOLS, mjpegtools,
  [http://mjpeg.sourceforge.net/])
 if test x"$have_mjpegtools" = x"yes" ; then
   # check if mjpegtools version >= Mar 31 2004
@@ -1145,12 +1133,11 @@ TC_PKG_HAVE(mjpegtools, MJPEGTOOLS)
 dnl
 dnl SDL
 dnl
-TC_PKG_CHECK(sdl, no, SDL, sdl-config, SDL.h, SDL, SDL_Init, SDL,
-  [http://www.libsdl.org/])
+TC_PKG_CONFIG_CHECK(sdl, no, SDL, sdl, [http://www.libsdl.org/])
 if test x"$have_sdl" = x"yes" ; then
   sdl_major_version=1
-  sdl_minor_version=1
-  sdl_micro_version=6
+  sdl_minor_version=2
+  sdl_micro_version=5
   save_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
diff --git a/docs/Makefile.in b/docs/Makefile.in
index dc754c1..e697af3 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -136,6 +136,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -148,6 +150,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -229,7 +235,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -245,22 +250,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -268,7 +266,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -277,11 +274,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/docs/html/Makefile.in b/docs/html/Makefile.in
index 4803019..4155117 100644
--- a/docs/html/Makefile.in
+++ b/docs/html/Makefile.in
@@ -122,6 +122,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -134,6 +136,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -215,7 +221,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -231,22 +236,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -254,7 +252,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -263,11 +260,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/docs/man/Makefile.in b/docs/man/Makefile.in
index 4f3dd14..bed214d 100644
--- a/docs/man/Makefile.in
+++ b/docs/man/Makefile.in
@@ -116,6 +116,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -128,6 +130,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -209,7 +215,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -225,22 +230,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -248,7 +246,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -257,11 +254,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/docs/pvm3/Makefile.in b/docs/pvm3/Makefile.in
index efee304..3e54816 100644
--- a/docs/pvm3/Makefile.in
+++ b/docs/pvm3/Makefile.in
@@ -124,6 +124,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -136,6 +138,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -217,7 +223,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -233,22 +238,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -256,7 +254,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -265,11 +262,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/docs/tech/Makefile.in b/docs/tech/Makefile.in
index 3086b85..61381b0 100644
--- a/docs/tech/Makefile.in
+++ b/docs/tech/Makefile.in
@@ -136,6 +136,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -148,6 +150,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -229,7 +235,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -245,22 +250,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -268,7 +266,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -277,11 +274,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/docs/tech/html/Makefile.in b/docs/tech/html/Makefile.in
index 7b125f1..129b750 100644
--- a/docs/tech/html/Makefile.in
+++ b/docs/tech/html/Makefile.in
@@ -122,6 +122,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -134,6 +136,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -215,7 +221,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -231,22 +236,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -254,7 +252,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -263,11 +260,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/encode/Makefile.in b/encode/Makefile.in
index dbc21f8..aeea570 100644
--- a/encode/Makefile.in
+++ b/encode/Makefile.in
@@ -207,6 +207,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -219,6 +221,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -300,7 +306,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -316,22 +321,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -339,7 +337,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -348,11 +345,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/encode/encode_x264.c b/encode/encode_x264.c
index b18d369..9fb820f 100644
--- a/encode/encode_x264.c
+++ b/encode/encode_x264.c
@@ -166,7 +166,11 @@ static TCConfigEntry conf[] ={
     /* How often B-frames are used */
     OPT_RANGE(i_bframe_bias,              "b_bias",       -90,   100)
     /* Keep some B-frames as references */
+#if X264_BUILD >= 78
+    OPT_RANGE(i_bframe_pyramid,           "b_pyramid",      0,     2)
+#else
     OPT_FLAG (b_bframe_pyramid,           "b_pyramid")
+#endif
 
     /* Use deblocking filter */
     OPT_FLAG (b_deblocking_filter,        "deblock")
@@ -949,7 +953,11 @@ static int x264_encode_video(TCModuleInstance *self,
      * done? */
     pic.i_pts = (int64_t) pd->framenum * pd->x264params.i_fps_den;
 
+#if X264_BUILD >= 76
+    if (x264_encoder_encode(pd->enc, &nal, &nnal, &pic, &pic_out) < 0) {
+#else
     if (x264_encoder_encode(pd->enc, &nal, &nnal, &pic, &pic_out) != 0) {
+#endif
         return TC_ERROR;
     }
 
@@ -962,6 +970,10 @@ static int x264_encode_video(TCModuleInstance *self,
             tc_log_error(MOD_NAME, "output buffer overflow");
             return TC_ERROR;
         }
+#if X264_BUILD >= 76
+	memcpy(outframe->video_buf + outframe->video_len, nal[i].p_payload, nal[i].i_payload); 
+	outframe->video_len += nal[i].i_payload;
+#else
         ret = x264_nal_encode(outframe->video_buf + outframe->video_len,
                               &size, 1, &nal[i]);
         if (ret < 0 || size > outframe->video_size - outframe->video_len) {
@@ -969,6 +981,7 @@ static int x264_encode_video(TCModuleInstance *self,
             break;
         }
         outframe->video_len += size;
+#endif
     }
 
     /* FIXME: ok, that sucks. How to reformat it ina better way? -- fromani */
diff --git a/export/Makefile.in b/export/Makefile.in
index 3d0984e..4402d41 100644
--- a/export/Makefile.in
+++ b/export/Makefile.in
@@ -348,6 +348,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -360,6 +362,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -441,7 +447,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -457,22 +462,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -480,7 +478,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -489,11 +486,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/Makefile.in b/filter/Makefile.in
index dfdb218..fd434c6 100644
--- a/filter/Makefile.in
+++ b/filter/Makefile.in
@@ -480,6 +480,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -492,6 +494,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -573,7 +579,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -589,22 +594,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -612,7 +610,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -621,11 +618,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/divxkey/Makefile.in b/filter/divxkey/Makefile.in
index ee5a68c..839966b 100644
--- a/filter/divxkey/Makefile.in
+++ b/filter/divxkey/Makefile.in
@@ -144,6 +144,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -156,6 +158,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -237,7 +243,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -253,22 +258,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -276,7 +274,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -285,11 +282,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/extsub/Makefile.in b/filter/extsub/Makefile.in
index 909b20a..4d59d31 100644
--- a/filter/extsub/Makefile.in
+++ b/filter/extsub/Makefile.in
@@ -153,6 +153,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -165,6 +167,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -246,7 +252,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -262,22 +267,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -285,7 +283,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -294,11 +291,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/preview/Makefile.in b/filter/preview/Makefile.in
index b7684ee..21ba984 100644
--- a/filter/preview/Makefile.in
+++ b/filter/preview/Makefile.in
@@ -166,6 +166,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -181,6 +183,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -262,7 +268,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -278,22 +283,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -301,7 +299,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -310,11 +307,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/stabilize/Changelog b/filter/stabilize/Changelog
index ebb86fd..2444558 100644
--- a/filter/stabilize/Changelog
+++ b/filter/stabilize/Changelog
@@ -1,3 +1,20 @@
+0.6    
+	new field placement allows for any number of fields 
+	 and respects aspect ratio
+	fields with low contrast are ignored
+	non-symmetric field setups are possible
+
+0.5    
+	global and per-frame zooming supported
+	optimal zoom value is calculated to avoid moving border	effect	
+	add filter unsharp to sharpen the frames
+	write parameters to transforms file
+
+0.44	
+	bugfixing
+	finished RGB support
+	transforms file format supports comments
+
 0.42
 	input filename and tc_list stuff used
 0.41    
diff --git a/filter/stabilize/Makefile.in b/filter/stabilize/Makefile.in
index 02a9e27..0e1158e 100644
--- a/filter/stabilize/Makefile.in
+++ b/filter/stabilize/Makefile.in
@@ -152,6 +152,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -164,6 +166,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -245,7 +251,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -261,22 +266,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -284,7 +282,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -293,11 +290,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/stabilize/filter_stabilize.c b/filter/stabilize/filter_stabilize.c
index 058a92f..7ce1410 100644
--- a/filter/stabilize/filter_stabilize.c
+++ b/filter/stabilize/filter_stabilize.c
@@ -22,12 +22,6 @@
  *
  */
 
-/* TODO:
- * o [georg] Write parameters to transforms file (allow comments) 
- *
- * * Introduce confidence in translation vectors from single fields
- */
-
 /* Typical call:
  *  transcode -V -J stabilize="maxshift=48:fieldsize=48" 
  *         -i inp.m2v -y null,null -o dummy
@@ -35,7 +29,7 @@
 */
 
 #define MOD_NAME    "filter_stabilize.so"
-#define MOD_VERSION "v0.4.3 (2008-11-30)"
+#define MOD_VERSION "v0.61 (2009-10-25)"
 #define MOD_CAP     "extracts relative transformations of \n\
     subsequent frames (used for stabilization together with the\n\
     transform filter in a second pass)"
@@ -72,6 +66,7 @@ typedef struct _field {
 typedef struct _stab_data {
     size_t framesize;  // size of frame buffer in bytes (prev)
     unsigned char* curr; // current frame buffer (only pointer)
+    unsigned char* currcopy; // copy of the current frame needed for drawing
     unsigned char* prev; // frame buffer for last frame (copied)
     short hasSeenOneFrame; // true if we have a valid previous frame
 
@@ -89,8 +84,11 @@ typedef struct _stab_data {
     int stepsize; // stepsize of field transformation detection
     int allowmax; // 1 if maximal shift is allowed
     int algo;     // algorithm to use
-    int field_num;   // number of meaurement fields
-    int field_size; // size    = MIN(sd->width, sd->height)/10;
+    int field_num;   // number of measurement fields
+    int field_size; // size    = min(sd->width, sd->height)/10;
+    int show; // if 1 then the fields and transforms are shown in the frames;
+    /* measurement fields with lower contrast are discarded */
+    double contrast_threshold;            
   
     int t;
     char* result;
@@ -109,36 +107,43 @@ static const char stabilize_help[] = ""
     "     (translation, rotation) about subsequent frames."
     " See also transform.\n" 
     "Options\n"
-    "    'result'     path to the file used to write the transforms\n"
-    "                 (def:inputfile.stab)\n"
-    "    'maxshift'   maximal number of pixels to search for a transformation\
-\n                 (def:48, preferably a multiple of stepsize)\n"
-    "    'stepsize'   stepsize of search process, \n"
-    "                 region around minimum is scanned with 1 pixel\n"
-    "                 resolution (def:2)\n"
-    "    'allowmax'   0: maximal shift is set to 0 (considered to be an error)\
-\n                 1: maximal shift is allowed (def:1)\n"
-    "    'algo'       0: brute force (translation only);\n"
-    "                 1: small measurement fields(def)\n"
-    "    'fieldsetup' number of measurement fields in each dim: \n\
-                 1: 1; 3: 9; 5: 25 (def: 3 meaning 9 fields)\n"
-    "    'fieldsize'  size of measurement field (default height/10)\n"
-    "    'help'       print this help message\n";
-
-int initFields(StabData* sd, int field_setup);
+    "    'result'      path to the file used to write the transforms\n"
+    "                  (def:inputfile.stab)\n"
+    "    'maxshift'    maximal number of pixels to search for a translation\n"
+    "                  (def:height/12, preferably a multiple of stepsize)\n"
+    "    'stepsize'    stepsize of search process, \n"
+    "                  region around minimum is scanned with 1 pixel\n"
+    "                  resolution (def:2)\n"
+    "    'allowmax'    0: maximal shift is not applied (prob. error)\n"
+    "                  1: maximal shift is allowed (def:1)\n"
+    "    'algo'        0: brute force (translation only);\n"
+    "                  1: small measurement fields(def)\n"
+    "    'fieldnum'    number of measurement fields (def: 20)\n"
+    "    'fieldsize'   size of measurement field (def: height/15)\n"
+    "    'mincontrast' below this contrast a field is discarded (def: 0.15)\n"
+    "    'show'        0: do nothing (def); 1: show fields and transforms\n"
+    "    'help'        print this help message\n";
+
+int initFields(StabData* sd);
 double compareImg(unsigned char* I1, unsigned char* I2, 
 		  int width, int height,  int bytesPerPixel, int d_x, int d_y);
-double compareSubImg(unsigned char* I1, unsigned char* I2, 
+double compareSubImg(unsigned char* const I1, unsigned char* const I2, 
 		     const Field* field, 
 		     int width, int height, int bytesPerPixel,int d_x,int d_y);
+double contrastSubImg(unsigned char* const I, const Field* field, 
+                      int width, int height, int bytesPerPixel);
 Transform calcShiftRGBSimple(StabData* sd);
 Transform calcShiftYUVSimple(StabData* sd);
-double calcAngle(StabData* sd, Field* field, Transform* t);
+double calcAngle(StabData* sd, Field* field, Transform* t,
+                 int center_x, int center_y);
 Transform calcFieldTransYUV(StabData* sd, const Field* field, 
                             int fieldnum);
 Transform calcFieldTransRGB(StabData* sd, const Field* field, 
                             int fieldnum);
 Transform calcTransFields(StabData* sd, calcFieldTransFunc fieldfunc);
+void drawFieldAndTrans(StabData* sd, const Field* field, const Transform* t);
+void drawBox(unsigned char* I, int width, int height, int bytesPerPixel, 
+             int x, int y, int sizex, int sizey, unsigned char color);
 void addTrans(StabData* sd, Transform sl);
 
 void addTrans(StabData* sd, Transform sl)
@@ -150,34 +155,37 @@ void addTrans(StabData* sd, Transform sl)
 }
 
 
+
 /** initialise measurement fields on the frame
-    @param field_setup 1: only one field, 3 some fields (9), 5: many (25)
+    @param field_num: number of fields 
+      (<4: one row; <7: 2 rows; <16: 3 rows; <30: 4 rows
 */
-int initFields(StabData* sd, int field_setup)
+int initFields(StabData* sd)
 {
-    if (field_setup < 1) 
-        field_setup = 1;
-
-    sd->field_num = field_setup*field_setup;  
+    int rows = TC_MAX(1,myround(sqrt(sd->field_num)*sd->height/sd->width));
+    int max_cols = ceil(sd->field_num / (double)rows);
+    int long_row = rows/2;
+    int min_cols = rows > 1? (sd->field_num - max_cols)/(rows-1) : 1;
+    // make sure that the remaining rows have the same length
+    sd->field_num = max_cols + (rows-1)*min_cols;
+    
     if (!(sd->fields = tc_malloc(sizeof(Field) * sd->field_num))) {
         tc_log_error(MOD_NAME, "malloc failed!\n");
         return 0;
     } else {
         int i, j;
-        int s;
         int f=0;
-        int center_x= sd->width/2;
-        int center_y= sd->height/2;
-        int size    = sd->field_size;
-        int step_x  = (field_setup == 1) ? 0 : 
-            (sd->width  - size - 2*sd->maxshift - 2)/(field_setup - 1);
-        int step_y  = (field_setup == 1) ? 0 : 
-            (sd->height - size - 2*sd->maxshift - 2)/(field_setup - 1);
-        s=field_setup/2;
-        for (i = -s; i <= s; i++) {
-            for (j = -s; j <= s; j++) {
-                sd->fields[f].x = center_x + i*step_x;
-                sd->fields[f].y = center_y + j*step_y;
+        int size     = sd->field_size;
+        int border   = size + 2*sd->maxshift + sd->stepsize;
+        int step_y   = (sd->height - border)/(rows);
+        for (j = 0; j < rows; j++) {
+            int cols = (j==long_row) ? max_cols : min_cols;
+            tc_log_msg(MOD_NAME, "field setup: row %i with %i fields", 
+                       j+1, cols);
+            int step_x  = (sd->width  - border)/(cols); 
+            for (i = 0; i < cols; i++) {
+                sd->fields[f].x = border/2 + i*step_x + step_x/2;
+                sd->fields[f].y = border/2 + j*step_y + step_y/2;
                 sd->fields[f].size = size;
 #ifdef STABVERBOSE
                 tc_log_msg(MOD_NAME, "field %2i: %i, %i\n", 
@@ -257,7 +265,8 @@ double compareImg(unsigned char* I1, unsigned char* I2,
    \param d_x shift in x direction
    \param d_y shift in y direction   
 */
-double compareSubImg(unsigned char* I1, unsigned char* I2, const Field* field, 
+double compareSubImg(unsigned char* const I1, unsigned char* const I2, 
+                     const Field* field, 
                      int width, int height, int bytesPerPixel, int d_x, int d_y)
 {
     int k, j;
@@ -281,7 +290,35 @@ double compareSubImg(unsigned char* I1, unsigned char* I2, const Field* field,
     return sum/((double) field->size *field->size* bytesPerPixel);
 }
 
+/**
+   calculates Michelson-contrast in the given small part of the given image
+     
+   \param I pointer to framebuffer 
+   \param field Field specifies position(center) and size of subimage 
+   \param width width of frame
+   \param height height of frame
+*/
+double contrastSubImg(unsigned char* const I, const Field* field, 
+                     int width, int height, int bytesPerPixel)
+{
+    int k, j;
+    unsigned char* p = NULL;
+    int s2 = field->size / 2;
+    unsigned char mini = 255;
+    unsigned char maxi = 0;
 
+    p = I + ((field->x - s2) + (field->y - s2)*width)*bytesPerPixel;
+    // TODO: use some mmx or sse stuff here
+    for (j = 0; j < field->size; j++){
+        for (k = 0; k < field->size * bytesPerPixel; k++) {
+            mini = (mini < *p) ? mini : *p;
+            maxi = (mini > *p) ? maxi : *p;
+            p++;
+        }
+        p += (width - field->size) * bytesPerPixel;
+    }
+    return (maxi-mini)/(maxi+mini+0.1); // +0.1 to avoid division by 0
+}
 
 /** tries to register current frame onto previous frame.
     This is the most simple algorithm:
@@ -301,10 +338,10 @@ Transform calcShiftRGBSimple(StabData* sd)
                 minerror = error;
                 x = i;
                 y = j;
-            }	
+           }	
         }
     } 
-    return new_transform(x, y, 0, 0);
+    return new_transform(x, y, 0, 0, 0);
 }
 
 
@@ -327,7 +364,6 @@ Transform calcShiftYUVSimple(StabData* sd)
     fprintf(f, "# splot \"%s\"\n", buffer);
 #endif
 
-
     // we only use the luminance part of the image
     Y_c  = sd->curr;  
     //  Cb_c = sd->curr + sd->width*sd->height;
@@ -355,19 +391,19 @@ Transform calcShiftYUVSimple(StabData* sd)
     fclose(f);
     tc_log_msg(MOD_NAME, "Minerror: %f\n", minerror);
 #endif
-    return new_transform(x, y, 0, 0);
+    return new_transform(x, y, 0, 0, 0);
 }
 
 
 
-/* calulcates rotation angle for the given transform and 
- * field with respect to center
+/* calculates rotation angle for the given transform and 
+ * field with respect to the given center-point
  */
-double calcAngle(StabData* sd, Field* field, Transform* t)
+double calcAngle(StabData* sd, Field* field, Transform* t, 
+                 int center_x, int center_y)
 {
-    int center_x = sd->width/2;
-    int center_y = sd->height/2;
-    if (field->x == center_x && field->y == center_y) {
+    // we better ignore fields that are to close to the rotation center 
+    if (abs(field->x - center_x) + abs(field->y - center_y) < sd->maxshift) {
         return 0;
     } else {
         // double r = sqrt(field->x*field->x + field->y*field->y);   
@@ -391,22 +427,30 @@ Transform calcFieldTransYUV(StabData* sd, const Field* field, int fieldnum)
     // we only use the luminance part of the image
     int i, j;
 
+    // check contrast in sub image
+    double contr = contrastSubImg(Y_c, field, sd->width, sd->height, 1);
+    if(contr < sd->contrast_threshold) {
+        t.extra=-1;
+        return t;
+    }
 #ifdef STABVERBOSE
+    // printf("%i %i %f\n", sd->t, fieldnum, contr);    
     FILE *f = NULL;
     char buffer[32];
     tc_snprintf(buffer, sizeof(buffer), "f%04i_%02i.dat", sd->t, fieldnum);
     f = fopen(buffer, "w");
     fprintf(f, "# splot \"%s\"\n", buffer);
-#endif
-  
-    double minerror = 1e20;  
+#endif    
+
+    double minerror = 1e10;  
+    double error = 1e10;
     for (i = -sd->maxshift; i <= sd->maxshift; i += sd->stepsize) {
         for (j = -sd->maxshift; j <= sd->maxshift; j += sd->stepsize) {
-            double error = compareSubImg(Y_c, Y_p, field, 
+            error = compareSubImg(Y_c, Y_p, field, 
                                          sd->width, sd->height, 1, i, j);
 #ifdef STABVERBOSE
             fprintf(f, "%i %i %f\n", i, j, error);
-#endif
+#endif 
             if (error < minerror) {
                 minerror = error;
                 t.x = i;
@@ -414,14 +458,15 @@ Transform calcFieldTransYUV(StabData* sd, const Field* field, int fieldnum)
             }	
         }
     }
-    if (sd->stepsize > 1) {
+
+    if (sd->stepsize > 1) {    // make fine grain check around the best match
         int r = sd->stepsize - 1;
         for (i = t.x - r; i <= t.x + r; i += 1) {
             for (j = -t.y - r; j <= t.y + r; j += 1) {
                 if (i == t.x && j == t.y) 
                     continue; //no need to check this since already done
-                double error = compareSubImg(Y_c, Y_p, field, 
-                                             sd->width, sd->height, 1, i, j);
+                error = compareSubImg(Y_c, Y_p, field, 
+                                      sd->width, sd->height, 1, i, j);
 #ifdef STABVERBOSE
                 fprintf(f, "%i %i %f\n", i, j, error);
 #endif 	
@@ -497,18 +542,21 @@ Transform calcFieldTransRGB(StabData* sd, const Field* field, int fieldnum)
 
 /* tries to register current frame onto previous frame. 
  *   Algorithm:
- *   check all fields for vertical and horizontal transformation 
+ *   check all fields for vertical and horizontal transformation
  *   use minimal difference of all possible positions
- *   calculate shift as cleaned mean of all fields
- *   calculate rotation angle of each field in respect to center 
+ *   discards fields with low contrast 
+ *   calculate shift as cleaned mean of all remaining fields
+ *   calculate rotation angle of each field in respect to center of fields
  *   after shift removal
- *   calculate rotation angle as cleaned mean of all angle
+ *   calculate rotation angle as cleaned mean of all angles
+ *   compensate for possibly off-center rotation
 */
 Transform calcTransFields(StabData* sd, calcFieldTransFunc fieldfunc)
 {
     Transform* ts  = tc_malloc(sizeof(Transform) * sd->field_num);
+    Field** fs     = tc_malloc(sizeof(Field*) * sd->field_num);
     double *angles = tc_malloc(sizeof(double) * sd->field_num);
-    int i;
+    int i, index=0, num_trans;
     Transform t;
 #ifdef STABVERBOSE
     FILE *f = NULL;
@@ -517,51 +565,112 @@ Transform calcTransFields(StabData* sd, calcFieldTransFunc fieldfunc)
     f = fopen(buffer, "w");
     fprintf(f, "# plot \"%s\" w l, \"\" every 2:1:0\n", buffer);
 #endif
-
+    
     for (i = 0; i < sd->field_num; i++) {
-        ts[i] = fieldfunc(sd, &sd->fields[i], i);
-        //ts[i] = calcFieldTransYUV(sd, &sd->fields[i], i);
+        t =  fieldfunc(sd, &sd->fields[i], i); // e.g. calcFieldTransYUV
 #ifdef STABVERBOSE
-        fprintf(f, "%i %i\n%f %f\n \n\n", sd->fields[i].x, sd->fields[i].y, 
-                sd->fields[i].x + ts[i].x, sd->fields[i].y + ts[i].y);
+        fprintf(f, "%i %i\n%f %f %i\n \n\n", sd->fields[i].x, sd->fields[i].y, 
+                sd->fields[i].x + t.x, sd->fields[i].y + t.y, t.extra);
 #endif
+        if (t.extra != -1){ // ignore if extra == -1 (contrast too low)
+            ts[index] = t;
+            fs[index] = sd->fields+i;
+            index++;
+        }
     }
-
-/*   // average over all transforms */
-/*   { */
-/*     Transform sum = null_transform(); */
-/*     for (i=0; i < sd->field_num; i++){ */
-/*       sum = add_transforms(&sum, &ts[i]); */
-/*     } */
-/*     t = mult_transform(&sum, 1.0/ sd->field_num); */
-/*   } */
+    t = null_transform();
+    num_trans = index; // amount of transforms we actually have    
+    if (num_trans < 1) {
+        tc_log_warn(MOD_NAME, "too low contrast! No field remains. Use larger fild size.");
+        return t;
+    }
+        
+    int center_x = 0;
+    int center_y = 0;
+    // calc center point of all remaining fields
+    for (i = 0; i < num_trans; i++) {
+        center_x += fs[i]->x;
+        center_y += fs[i]->y;            
+    } 
+    center_x /= num_trans;
+    center_y /= num_trans;        
+    
+    if (sd->show){ // draw fields and transforms into frame
+        for (i = 0; i < num_trans; i++) {
+            drawFieldAndTrans(sd, fs[i], &ts[i]);            
+        }
+    } 
     /* median over all transforms
-     * t= median_xy_transform(ts, sd->field_num);
-     * cleaned mean
-     */
-    t= cleanmean_xy_transform(ts, sd->field_num);
+       t= median_xy_transform(ts, sd->field_num);*/
+    // cleaned mean    
+    t = cleanmean_xy_transform(ts, num_trans);
 
     // substract avg
-    for (i = 0; i < sd->field_num; i++) {
+    for (i = 0; i < num_trans; i++) {
         ts[i] = sub_transforms(&ts[i], &t);
     }
     // figure out angle
     if (sd->field_num == 1) {
         t.alpha = 0; // one is always the center
-    } else{      
-        for (i = 0; i < sd->field_num; i++) {
-            angles[i] = calcAngle(sd, &sd->fields[i], &ts[i]);
+    } else {      
+        for (i = 0; i < num_trans; i++) {
+            angles[i] = calcAngle(sd, fs[i], &ts[i], center_x, center_y);
         }
-        // t.alpha = - mean(angles, sd->field_num);
-        // t.alpha = - median(angles, sd->field_num);
-        t.alpha = -cleanmean(angles, sd->field_num);
+        // t.alpha = - mean(angles, num_trans);
+        // t.alpha = - median(angles, num_trans);
+        t.alpha = -cleanmean(angles, num_trans);
+    }
+    // compensate for off-center rotation
+    if(num_trans < sd->field_num){
+        double p_x = (center_x - sd->width/2);
+        double p_y = (center_y - sd->height/2);
+        t.x += (cos(t.alpha)-1)*p_x  - sin(t.alpha)*p_y;
+        t.y += sin(t.alpha)*p_x  + (cos(t.alpha)-1)*p_y;
     }
+    
 #ifdef STABVERBOSE
     fclose(f);
 #endif
     return t;
 }
 
+/**
+ * draws the field and the transform data into the frame 
+ */
+void drawFieldAndTrans(StabData* sd, const Field* field, const Transform* t){
+    if(!sd->vob->im_v_codec == CODEC_YUV)
+        return;
+    // draw field with shift
+    drawBox(sd->curr, sd->width, sd->height, 1, field->x, field->y, 
+            field->size+2*sd->maxshift, field->size+2*sd->maxshift, 80);
+    drawBox(sd->curr, sd->width, sd->height, 1, field->x, field->y, 
+            field->size, field->size, t->extra == -1 ? 100 : 40);
+    // draw center
+    drawBox(sd->curr, sd->width, sd->height, 1, field->x, field->y, 5, 5, 128);
+    // draw translation
+    drawBox(sd->curr, sd->width, sd->height, 1, 
+            field->x + t->x, field->y + t->y, 8, 8, 250);    
+}
+
+/**
+ * draws a box at the given position x,y (center) in the given color
+   (the same for all channels) 
+ */
+void drawBox(unsigned char* I, int width, int height, int bytesPerPixel, 
+             int x, int y, int sizex, int sizey, unsigned char color){
+    
+    unsigned char* p = NULL;     
+    int j,k;
+    p = I + ((x - sizex/2) + (y - sizey/2)*width)*bytesPerPixel;
+    for (j = 0; j < sizey; j++){
+        for (k = 0; k < sizex * bytesPerPixel; k++) {
+            *p = color;
+            p++;
+        }
+        p += (width - sizex) * bytesPerPixel;
+    }
+}
+
 struct iterdata {
     FILE *f;
     int  counter;
@@ -573,8 +682,8 @@ static int stabilize_dump_trans(TCListItem *item, void *userdata)
 
     if (item->data) {
         Transform* t = item->data;
-        fprintf(ID->f, "%i %5.4lf %5.4lf %8.5lf %i\n",
-                ID->counter, t->x, t->y, t->alpha, t->extra);
+        fprintf(ID->f, "%i %6.4lf %6.4lf %8.5lf %6.4lf %i\n",
+                ID->counter, t->x, t->y, t->alpha, t->zoom, t->extra);
         ID->counter++;
     }
     return 0; /* never give up */
@@ -593,12 +702,11 @@ static int stabilize_dump_trans(TCListItem *item, void *userdata)
 
 static int stabilize_init(TCModuleInstance *self, uint32_t features)
 {
-
     StabData* sd = NULL;
     TC_MODULE_SELF_CHECK(self, "init");
     TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);
 
-    sd = tc_zalloc(sizeof(StabData));
+    sd = tc_zalloc(sizeof(StabData)); // allocation with zero values
     if (!sd) {
         if (verbose > TC_INFO)
             tc_log_error(MOD_NAME, "init: out of memory!");
@@ -611,11 +719,6 @@ static int stabilize_init(TCModuleInstance *self, uint32_t features)
 
     /**** Initialise private data structure */
 
-    sd->t = 0;
-    sd->hasSeenOneFrame = 0;
-    sd->transs = 0;
-    sd->prev = 0;
-
     self->userdata = sd;
     if (verbose & TC_INFO){
         tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CAP);
@@ -646,9 +749,7 @@ static int stabilize_fini(TCModuleInstance *self)
  */
 static int stabilize_configure(TCModuleInstance *self,
             			       const char *options, vob_t *vob)
-{
-    int field_setup;
-
+{    
     StabData *sd = NULL;
     TC_MODULE_SELF_CHECK(self, "configure");
     char* filenamecopy, *filebasename;
@@ -658,11 +759,12 @@ static int stabilize_configure(TCModuleInstance *self,
     /*    sd->framesize = sd->vob->im_v_width * MAX_PLANES * 
           sizeof(char) * 2 * sd->vob->im_v_height * 2;     */
     sd->framesize = sd->vob->im_v_size;    
-    sd->prev = tc_zalloc(sd->framesize); /* FIXME */
+    sd->prev = tc_zalloc(sd->framesize);    
     if (!sd->prev) {
         tc_log_error(MOD_NAME, "malloc failed");
         return TC_ERROR;
     }
+    sd->currcopy = 0;
 
     sd->width  = sd->vob->ex_v_width;
     sd->height = sd->vob->ex_v_height;
@@ -671,7 +773,6 @@ static int stabilize_configure(TCModuleInstance *self,
     sd->transs = 0;
     
     // Options
-    sd->maxshift = 48;
     sd->stepsize = 2;
     sd->allowmax = 1;
     sd->result = tc_malloc(TC_BUF_LINE);
@@ -685,17 +786,29 @@ static int stabilize_configure(TCModuleInstance *self,
         tc_snprintf(sd->result, TC_BUF_LINE, DEFAULT_TRANS_FILE_NAME);
     }
     sd->algo = 1;
-    field_setup = 3;
-    sd->field_size = TC_MIN(sd->width, sd->height)/10;
+    sd->field_num   = 20;
+    sd->field_size  = TC_MIN(sd->width, sd->height)/15;
+    sd->maxshift    = TC_MIN(sd->width, sd->height)/12;
+    sd->show        = 0;
+    sd->contrast_threshold = 0.15; 
 
     if (options != NULL) {            
-        optstr_get(options, "result",    "%[^:]", sd->result);
-        optstr_get(options, "maxshift",  "%d", &sd->maxshift);
-        optstr_get(options, "stepsize",  "%d", &sd->stepsize);
-        optstr_get(options, "allowmax",  "%d", &sd->allowmax);
-        optstr_get(options, "algo",      "%d", &sd->algo);
-        optstr_get(options, "fieldsetup","%d", &field_setup);
-        optstr_get(options, "fieldsize", "%d", &sd->field_size);
+        // for some reason this plugin is called in the old fashion 
+        //  (not with inspect). Anyway we support both ways of getting help.
+        if(optstr_lookup(options, "help")) {
+            tc_log_info(MOD_NAME,stabilize_help);
+            return(TC_IMPORT_ERROR);
+        }
+
+        optstr_get(options, "result",     "%[^:]", sd->result);
+        optstr_get(options, "maxshift",   "%d", &sd->maxshift);
+        optstr_get(options, "stepsize",   "%d", &sd->stepsize);
+        optstr_get(options, "allowmax",   "%d", &sd->allowmax);
+        optstr_get(options, "algo",       "%d", &sd->algo);
+        optstr_get(options, "fieldnum",   "%d", &sd->field_num);
+        optstr_get(options, "fieldsize",  "%d", &sd->field_size);
+        optstr_get(options, "mincontrast","%lf", &sd->contrast_threshold);
+        optstr_get(options, "show",       "%d", &sd->show);
     }
     if (verbose) {
         tc_log_info(MOD_NAME, "Image Stabilization Settings:");
@@ -703,8 +816,10 @@ static int stabilize_configure(TCModuleInstance *self,
         tc_log_info(MOD_NAME, "      stepsize = %d", sd->stepsize);
         tc_log_info(MOD_NAME, "      allowmax = %d", sd->allowmax);
         tc_log_info(MOD_NAME, "          algo = %d", sd->algo);
-        tc_log_info(MOD_NAME, "    fieldsetup = %d", field_setup);
+        tc_log_info(MOD_NAME, "      fieldnum = %d", sd->field_num);
         tc_log_info(MOD_NAME, "     fieldsize = %d", sd->field_size);
+        tc_log_info(MOD_NAME, "   mincontrast = %f", sd->contrast_threshold);
+        tc_log_info(MOD_NAME, "          show = %d", sd->show);
         tc_log_info(MOD_NAME, "        result = %s", sd->result);
     }
     
@@ -714,7 +829,7 @@ static int stabilize_configure(TCModuleInstance *self,
         sd->maxshift = sd->height / 2;
 
     if (sd->algo==1) {
-        if (!initFields(sd, field_setup)) {
+        if (!initFields(sd)) {
             return TC_ERROR;
         }
     }
@@ -723,6 +838,9 @@ static int stabilize_configure(TCModuleInstance *self,
         tc_log_error(MOD_NAME, "cannot open result file %s!\n", sd->result);
         return TC_ERROR;
     }    
+    if (sd->show)
+        sd->currcopy = tc_zalloc(sd->framesize);
+
     return TC_OK;
 }
 
@@ -741,6 +859,9 @@ static int stabilize_filter_video(TCModuleInstance *self,
     TC_MODULE_SELF_CHECK(frame, "filter_video");
   
     sd = self->userdata;    
+
+    if(sd->show)  // save the buffer to restore at the end for prev
+        memcpy(sd->currcopy, frame->video_buf, sd->framesize);
     
     if (sd->hasSeenOneFrame) {
         sd->curr = frame->video_buf;
@@ -764,7 +885,11 @@ static int stabilize_filter_video(TCModuleInstance *self,
         addTrans(sd, null_transform());
     }
     
-    memcpy(sd->prev, frame->video_buf, sd->framesize);
+    if(!sd->show) { // copy current frame to prev for next frame comparison
+        memcpy(sd->prev, frame->video_buf, sd->framesize);
+    } else { // use the copy because we changed the original frame
+        memcpy(sd->prev, sd->currcopy, sd->framesize);
+    }
     sd->t++;
     return TC_OK;
 }
@@ -785,8 +910,17 @@ static int stabilize_stop(TCModuleInstance *self)
         struct iterdata ID;
         ID.counter = 0;
         ID.f       = sd->f;
-
-        fprintf(sd->f, "# Transforms\n#C FrameNr x y alpha extra\n");
+        // write parameters as comments to file 
+        fprintf(sd->f, "#      maxshift = %d\n", sd->maxshift);
+        fprintf(sd->f, "#      stepsize = %d\n", sd->stepsize);
+        fprintf(sd->f, "#      allowmax = %d\n", sd->allowmax);
+        fprintf(sd->f, "#          algo = %d\n", sd->algo);
+        fprintf(sd->f, "#      fieldnum = %d\n", sd->field_num);
+        fprintf(sd->f, "#     fieldsize = %d\n", sd->field_size);
+        fprintf(sd->f, "#        result = %s\n", sd->result);
+        // write header line
+        fprintf(sd->f, "# Transforms\n#C FrameNr x y alpha zoom extra\n");
+        // and all transforms
         tc_list_foreach(sd->transs, stabilize_dump_trans, &ID);
     
         fclose(sd->f);
@@ -808,7 +942,7 @@ static int stabilize_stop(TCModuleInstance *self)
 #define CHECKPARAM(paramname, formatstring, variable)       \
     if (optstr_lookup(param, paramname)) {                \
         tc_snprintf(sd->conf_str, sizeof(sd->conf_str),   \
-                    "maxshift=%i", sd->maxshift);         \
+                    formatstring, variable);         \
         *value = sd->conf_str;                            \
     }
 
@@ -821,7 +955,7 @@ static int stabilize_inspect(TCModuleInstance *self,
 			     const char *param, const char **value)
 {
     StabData *sd = NULL;
-
+    
     TC_MODULE_SELF_CHECK(self, "inspect");
     TC_MODULE_SELF_CHECK(param, "inspect");
     TC_MODULE_SELF_CHECK(value, "inspect");
@@ -834,7 +968,7 @@ static int stabilize_inspect(TCModuleInstance *self,
     CHECKPARAM("stepsize", "stepsize=%d",  sd->stepsize);
     CHECKPARAM("allowmax", "allowmax=%d",  sd->allowmax);
     CHECKPARAM("algo",     "algo=%d",      sd->algo);
-/*    CHECKPARAM("fieldsetup","fieldsetup=%d",sd->field_setup); */
+    CHECKPARAM("fieldnum", "fieldnum=%d",  sd->field_num); 
     CHECKPARAM("fieldsize","fieldsize=%d", sd->field_size);
     CHECKPARAM("result",   "result=%s",    sd->result);
     return TC_OK;
diff --git a/filter/stabilize/filter_transform.c b/filter/stabilize/filter_transform.c
index 200cbb0..bc135b0 100644
--- a/filter/stabilize/filter_transform.c
+++ b/filter/stabilize/filter_transform.c
@@ -21,26 +21,11 @@
  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  *
  * Typical call:
- * transcode -J transform="crop=0" -i inp.m2v -y xdiv,pcm inp_stab.avi
+ * transcode -J transform -i inp.m2v -y xdiv,tcaud inp_stab.avi
 */
 
-/* TODO:
- * o [georg] allow comments in transforms file 
- *
- * o [georg] When keep pixels from last frame for the border, also transform it by
- *  the estimated camera speed, this should give much better results
- *
- * * Sharpen the image after rotation. (now quadratic interpolation done)
- * 
- * * When possible with transcode then resize the image while
- *    rotating. This will provide better results, because now we do
- *    simple interpolation which makes the movie smoother.
- * 
- */
-
-
 #define MOD_NAME    "filter_transform.so"
-#define MOD_VERSION "v0.4.4 (2008-12-06)"
+#define MOD_VERSION "v0.61 (2009-10-25)"
 #define MOD_CAP     "transforms each frame according to transformations\n\
  given in an input file (e.g. translation, rotate) see also filter stabilize"
 #define MOD_AUTHOR  "Georg Martius"
@@ -98,7 +83,10 @@ typedef struct {
     /* constants */
     /* threshhold below which no rotation is performed */
     double rotation_threshhold; 
-    
+    double zoom;      // percentage to zoom: 0->no zooming 10:zoom in 10%
+    int optzoom;      // 1: determine optimal zoom, 0: nothing
+    double sharpen;   // amount of sharpening
+
     char input[TC_BUF_LINE];
     FILE* f;
 
@@ -110,16 +98,23 @@ static const char transform_help[] = ""
     "    Reads a file with transform information for each frame\n"
     "     and applies them. See also stabilize.\n" 
     "Options\n"
-    "    'input'     path to the file used to read the transforms\n\
-                (def: inputfile.stab)\n"
-    "    'maxshift'  maximal number of pixels to translate image\n\
-                (def: -1 no limit)\n"
+    "    'input'     path to the file used to read the transforms\n"
+    "                (def: inputfile.stab)\n"
+    "    'smoothing' number of frames*2 + 1 used for lowpass filtering \n"
+    "                used for stabilizing (def: 10)\n"
+    "    'maxshift'  maximal number of pixels to translate image\n"
+    "                (def: -1 no limit)\n"
     "    'maxangle'  maximal angle in rad to rotate image (def: -1 no limit)\n"
     "    'crop'      0: keep border (def), 1: black backgr\n"
     "    'invert'    1: invert transforms(def: 0)\n"
     "    'relative'  consider transforms as 0: absolute, 1: relative (def)\n"
-    "    'smoothing' number of frames*2 + 1 used for lowpass filtering \n"
-    "                used for stabilizing (def: 10)\n"
+    "    'zoom'      percentage to zoom >0: zoom in, <0 zoom out (def: 0)\n"
+    "    'optzoom'   0: nothing, 1: determine optimal zoom (def)\n"
+    "                i.e. no (or only little) border should be visible.\n"
+    "                Note that the value given at 'zoom' is added to the \n"
+    "                here calculated one\n"
+    "    'sharpen'   amount of sharpening: 0: no sharpening (def: 0.8)\n"
+    "                uses filter unsharp with 5x5 matrix\n"
     "    'help'      print this help message\n";
 
 /* forward deklarations, please look below for documentation*/
@@ -309,25 +304,29 @@ int transformYUV(TransformData* td)
     float c_s_y = td->height_src/2.0;
     float c_d_x = td->width_dest/2.0;
     float c_d_y = td->height_dest/2.0;    
+    
+    float z = 1.0-t.zoom/100;
+    float zcos_a = z*cos(-t.alpha); // scaled cos
+    float zsin_a = z*sin(-t.alpha); // scaled sin
 
     /* for each pixel in the destination image we calc the source
      * coordinate and make an interpolation: 
      *      p_d = c_d + M(p_s - c_s) + t 
      * where p are the points, c the center coordinate, 
      *  _s source and _d destination, 
-     *  t the translation, and M the rotation matrix
+     *  t the translation, and M the rotation and scaling matrix
      *      p_s = M^{-1}(p_d - c_d - t) + c_s
      */
     /* Luminance channel */
-    if (fabs(t.alpha) > td->rotation_threshhold) {
+    if (fabs(t.alpha) > td->rotation_threshhold || t.zoom != 0) {
         for (x = 0; x < td->width_dest; x++) {
             for (y = 0; y < td->height_dest; y++) {
                 float x_d1 = (x - c_d_x);
                 float y_d1 = (y - c_d_y);
-                float x_s  =  cos(-t.alpha) * x_d1 
-                    + sin(-t.alpha) * y_d1 + c_s_x -t.x;
-                float y_s  = -sin(-t.alpha) * x_d1 
-                    + cos(-t.alpha) * y_d1 + c_s_y -t.y;
+                float x_s  =  zcos_a * x_d1 
+                    + zsin_a * y_d1 + c_s_x -t.x;
+                float y_s  = -zsin_a * x_d1 
+                    + zcos_a * y_d1 + c_s_y -t.y;
                 unsigned char* dest = &Y_2[x + y * td->width_dest];
                 interpolate(dest, x_s, y_s, Y_1, 
                             td->width_src, td->height_src, 
@@ -335,8 +334,8 @@ int transformYUV(TransformData* td)
             }
         }
      }else { 
-        /* no rotation, just translation 
-         *(also no interpolation, since no size change (so far) 
+        /* no rotation, no zooming, just translation 
+         *(also no interpolation, since no size change (so far)) 
          */
         int round_tx = myround(t.x);
         int round_ty = myround(t.y);
@@ -359,15 +358,15 @@ int transformYUV(TransformData* td)
     int wd2 = td->width_dest/2;
     int hs2 = td->height_src/2;
     int hd2 = td->height_dest/2;
-    if (fabs(t.alpha) > td->rotation_threshhold) {
+    if (fabs(t.alpha) > td->rotation_threshhold || t.zoom != 0) {
         for (x = 0; x < wd2; x++) {
             for (y = 0; y < hd2; y++) {
                 float x_d1 = x - (c_d_x)/2;
                 float y_d1 = y - (c_d_y)/2;
-                float x_s  =  cos(-t.alpha) * x_d1 
-                    + sin(-t.alpha) * y_d1 + (c_s_x -t.x)/2;
-                float y_s  = -sin(-t.alpha) * x_d1 
-                    + cos(-t.alpha) * y_d1 + (c_s_y -t.y)/2;
+                float x_s  =  zcos_a * x_d1 
+                    + zsin_a * y_d1 + (c_s_x -t.x)/2;
+                float y_s  = -zsin_a * x_d1 
+                    + zcos_a * y_d1 + (c_s_y -t.y)/2;
                 unsigned char* dest = &Cr_2[x + y * wd2];
                 interpolate(dest, x_s, y_s, Cr_1, ws2, hs2, 
                             td->crop ? 128 : *dest);
@@ -376,7 +375,7 @@ int transformYUV(TransformData* td)
                             td->crop ? 128 : *dest);      	
             }
         }
-    } else { // no rotation, no interpolation, just translation 
+    } else { // no rotation, no zoom, no interpolation, just translation 
         int round_tx2 = myround(t.x/2.0);
         int round_ty2 = myround(t.y/2.0);        
         for (x = 0; x < wd2; x++) {
@@ -423,17 +422,21 @@ int read_input_file(TransformData* td)
     int i = 0;
     int ti; // time (ignored)
     Transform t;
-
+    
     while (fgets(l, sizeof(l), td->f)) {
         if (l[0] == '#')
             continue;    //  ignore comments
         if (strlen(l) == 0)
             continue; //  ignore empty lines
-    
-        if (sscanf(l, "%i %lf %lf %lf %i", &ti, &t.x, &t.y, &t.alpha, 
-                  &t.extra) != 5) {
-            tc_log_error(MOD_NAME, "Cannot parse line: %s", l);
-            return 0;
+        // try new format
+        if (sscanf(l, "%i %lf %lf %lf %lf %i", &ti, &t.x, &t.y, &t.alpha, 
+                   &t.zoom, &t.extra) != 6) {
+            if (sscanf(l, "%i %lf %lf %lf %i", &ti, &t.x, &t.y, &t.alpha, 
+                       &t.extra) != 5) {                
+                tc_log_error(MOD_NAME, "Cannot parse line: %s", l);
+                return 0;
+            }
+            t.zoom=0;
         }
     
         if (i>=s) { // resize transform array
@@ -575,7 +578,28 @@ int preprocess_transforms(TransformData* td)
     if (td->maxangle != - 1.0)
         for (i = 0; i < td->trans_len; i++)
             ts[i].alpha = TC_CLAMP(ts[i].alpha, -td->maxangle, td->maxangle);
-  
+
+    /* Calc optimal zoom 
+     *  cheap algo is to only consider transformations
+     *  uses cleaned max and min 
+     */
+    if (td->optzoom != 0 && td->trans_len > 1){    
+        Transform min_t, max_t;
+        cleanmaxmin_xy_transform(ts, td->trans_len, 10, &min_t, &max_t); 
+        // the zoom value only for x
+        double zx = 2*TC_MAX(max_t.x,fabs(min_t.x))/td->width_src;
+        // the zoom value only for y
+        double zy = 2*TC_MAX(max_t.y,fabs(min_t.y))/td->height_src;
+        td->zoom += 100* TC_MAX(zx,zy); // use maximum
+        tc_log_info(MOD_NAME, "Final zoom: %lf\n", td->zoom);
+    }
+        
+    /* apply global zoom */
+    if (td->zoom != 0){
+        for (i = 0; i < td->trans_len; i++)
+            ts[i].zoom += td->zoom;       
+    }
+
     return 1;
 }
 
@@ -590,7 +614,7 @@ static int transform_init(TCModuleInstance *self, uint32_t features)
     TC_MODULE_SELF_CHECK(self, "init");
     TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);
     
-    td = tc_malloc(sizeof(TransformData));
+    td = tc_zalloc(sizeof(TransformData));
     if (td == NULL) {
         tc_log_error(MOD_NAME, "init: out of memory!");
         return TC_ERROR;
@@ -666,6 +690,10 @@ static int transform_configure(TCModuleInstance *self,
     td->smoothing = 10;
   
     td->rotation_threshhold = 0.25/(180/M_PI);
+
+    td->zoom    = 0;
+    td->optzoom = 1;
+    td->sharpen = 0.8;
   
     if (options != NULL) {
         optstr_get(options, "input", "%[^:]", (char*)&td->input);
@@ -681,25 +709,37 @@ static int transform_configure(TCModuleInstance *self,
 
     /* process remaining options */
     if (options != NULL) {    
+        // We support also the help option.
+        if(optstr_lookup(options, "help")) {
+            tc_log_info(MOD_NAME,transform_help);
+            return(TC_IMPORT_ERROR);
+        }
         optstr_get(options, "maxshift",  "%d", &td->maxshift);
         optstr_get(options, "maxangle",  "%lf", &td->maxangle);
         optstr_get(options, "smoothing", "%d", &td->smoothing);
         optstr_get(options, "crop"     , "%d", &td->crop);
         optstr_get(options, "invert"   , "%d", &td->invert);
         optstr_get(options, "relative" , "%d", &td->relative);
+        optstr_get(options, "zoom"     , "%lf",&td->zoom);
+        optstr_get(options, "optzoom"      , "%d", &td->optzoom);
+        optstr_get(options, "sharpen"  , "%lf",&td->sharpen);
     }
     if (verbose) {
         tc_log_info(MOD_NAME, "Image Transformation/Stabilization Settings:");
+        tc_log_info(MOD_NAME, "    input     = %s", td->input);
+        tc_log_info(MOD_NAME, "    smoothing = %d", td->smoothing);
         tc_log_info(MOD_NAME, "    maxshift  = %d", td->maxshift);
         tc_log_info(MOD_NAME, "    maxangle  = %f", td->maxangle);
-        tc_log_info(MOD_NAME, "    smoothing = %d", td->smoothing);
         tc_log_info(MOD_NAME, "    crop      = %s", 
                         td->crop ? "Black" : "Keep");
         tc_log_info(MOD_NAME, "    relative  = %s", 
                     td->relative ? "True": "False");
         tc_log_info(MOD_NAME, "    invert    = %s", 
                     td->invert ? "True" : "False");
-        tc_log_info(MOD_NAME, "    input     = %s", td->input);
+        tc_log_info(MOD_NAME, "    zoom      = %f", td->zoom);
+        tc_log_info(MOD_NAME, "    optzoom   = %s", 
+                    td->optzoom ? "True" : "False");
+        tc_log_info(MOD_NAME, "    sharpen   = %f", td->sharpen);
     }
   
     if (td->maxshift > td->width_dest/2
@@ -710,8 +750,20 @@ static int transform_configure(TCModuleInstance *self,
     if (!preprocess_transforms(td)) {
         tc_log_error(MOD_NAME, "error while preprocessing transforms!");
         return TC_ERROR;            
+    }  
+
+    /* TODO: is this the right point to add the filter?*/
+    if(td->sharpen>0){
+        /* load unsharp filter */
+        char unsharp_param[256];
+        sprintf(unsharp_param,"luma=%f:%s:chroma=%f:%s", 
+                td->sharpen, "luma_matrix=5x5", 
+                td->sharpen/2, "chroma_matrix=5x5");
+        if (!tc_filter_add("unsharp", unsharp_param)) {
+            tc_log_warn(MOD_NAME, "cannot load unsharp filter!");
+        }
     }
-  
+
     return TC_OK;
 }
 
@@ -793,7 +845,7 @@ static int transform_stop(TCModuleInstance *self)
 #define CHECKPARAM(paramname, formatstring, variable)       \
     if (optstr_lookup(param, paramname)) {                \
         tc_snprintf(td->conf_str, sizeof(td->conf_str),   \
-                    "maxshift=%i", td->maxshift);         \
+                    formatstring, variable);              \
         *value = td->conf_str;                            \
     }
 
@@ -805,7 +857,6 @@ static int transform_inspect(TCModuleInstance *self,
             			     const char *param, const char **value)
 {
     TransformData *td = NULL;
-    
     TC_MODULE_SELF_CHECK(self,  "inspect");
     TC_MODULE_SELF_CHECK(param, "inspect");
     TC_MODULE_SELF_CHECK(value, "inspect");
@@ -822,6 +873,9 @@ static int transform_inspect(TCModuleInstance *self,
     CHECKPARAM("relative", "relative=%d",  td->relative);
     CHECKPARAM("invert",   "invert=%i",    td->invert);
     CHECKPARAM("input",    "input=%s",     td->input);
+    CHECKPARAM("optzoom",  "optzoom=%i",   td->optzoom);
+    CHECKPARAM("zoom",     "zoom=%f",      td->zoom);
+    CHECKPARAM("sharpen",  "sharpen=%f",   td->sharpen);
         
     return TC_OK;
 };
diff --git a/filter/stabilize/transform.c b/filter/stabilize/transform.c
index fac612b..8cc2c67 100644
--- a/filter/stabilize/transform.c
+++ b/filter/stabilize/transform.c
@@ -41,18 +41,21 @@ int myround(double x)
         return (int)x_;
 }
 
+
 /***********************************************************************
  * helper functions to create and operate with transforms.
  * all functions are non-destructive
  */
 
 /* create an initialized transform*/
-Transform new_transform(double x, double y, double alpha, int extra)
+Transform new_transform(double x, double y, double alpha, 
+                        double zoom, int extra)
 { 
     Transform t;
     t.x     = x;
     t.y     = y;
     t.alpha = alpha;
+    t.zoom  = zoom;
     t.extra = extra;
     return t;
 }
@@ -60,7 +63,7 @@ Transform new_transform(double x, double y, double alpha, int extra)
 /* create a zero initialized transform*/
 Transform null_transform(void)
 { 
-    return new_transform(0, 0, 0, 0);
+    return new_transform(0, 0, 0, 0, 0);
 }
 
 /* adds two transforms */
@@ -70,6 +73,7 @@ Transform add_transforms(const Transform* t1, const Transform* t2)
     t.x     = t1->x + t2->x;
     t.y     = t1->y + t2->y;
     t.alpha = t1->alpha + t2->alpha;
+    t.zoom  = t1->zoom + t2->zoom;
     t.extra = 0;
     return t;
 }
@@ -87,6 +91,7 @@ Transform sub_transforms(const Transform* t1, const Transform* t2)
     t.x     = t1->x - t2->x;
     t.y     = t1->y - t2->y;
     t.alpha = t1->alpha - t2->alpha;
+    t.zoom  = t1->zoom - t2->zoom;
     t.extra = 0;
     return t;
 }
@@ -98,6 +103,7 @@ Transform mult_transform(const Transform* t1, double f)
     t.x     = t1->x * f;
     t.y     = t1->y * f;
     t.alpha = t1->alpha * f;
+    t.zoom  = t1->zoom * f;
     t.extra = 0;
     return t;
 }
@@ -165,6 +171,7 @@ Transform median_xy_transform(const Transform* transforms, int len)
     qsort(ts, len, sizeof(Transform), cmp_trans_y);
     t.y = len % 2 == 0 ? ts[half].y : (ts[half].y + ts[half+1].y)/2;
     t.alpha = 0;
+    t.zoom = 0;
     t.extra = 0;
     tc_free(ts);
     return t;
@@ -205,6 +212,40 @@ Transform cleanmean_xy_transform(const Transform* transforms, int len)
 }
 
 
+/** 
+ * calulcates the cleaned maximum and minimum of an array of transforms,
+ * considerung only x and y
+ * It cuts off the upper and lower x-th percentil
+ *
+ * Parameters:
+ *    transforms: array of transforms.
+ *           len: length  of array
+ *     percentil: the x-th percentil to cut off
+ *           min: pointer to min (return value)
+ *           max: pointer to max (return value)
+ * Return value:
+ *     call by reference in min and max
+ * Preconditions:
+ *     len>0, 0<=percentil<50
+ * Side effects:
+ *     only on min and max
+ */
+void cleanmaxmin_xy_transform(const Transform* transforms, int len, 
+                              int percentil, 
+                              Transform* min, Transform* max){
+    Transform* ts = tc_malloc(sizeof(Transform) * len);
+    int i, cut = len * percentil / 100;
+    memcpy(ts, transforms, sizeof(Transform) * len); 
+    qsort(ts,len, sizeof(Transform), cmp_trans_x);
+    min->x = ts[cut].x;
+    max->x = ts[len-cut-1].x;
+    qsort(ts, len, sizeof(Transform), cmp_trans_y);
+    min->y = ts[cut].y;
+    max->y = ts[len-cut-1].y;
+    tc_free(ts);
+}
+
+
 /**
  * media: median of a double array
  *
diff --git a/filter/stabilize/transform.h b/filter/stabilize/transform.h
index 340d1fa..af50644 100644
--- a/filter/stabilize/transform.h
+++ b/filter/stabilize/transform.h
@@ -26,19 +26,19 @@
 #define DEFAULT_TRANS_FILE_NAME     "transforms.dat"
 
 /* structure to hold information about frame transformations 
-   x,y are translations' alpha is a rotation around the center in RAD
-   and extra is for additional information (unused)
+   x,y are translations, alpha is a rotation around the center in RAD,
+   zoom is a percentage to zoom in and
+   extra is for additional information like scene cut (unused)
  */
 typedef struct _transform {
     double x;
     double y;
     double alpha;
-    int extra;    // 0 for normal trans; 1 for inter scene cut 
+    double zoom;
+    int extra;    /* -1: ignore transform (only internal use);
+                     0 for normal trans; 1 for inter scene cut (unused) */
 } Transform;
 
-/* normal round function */
-int myround(double x);
-
 /* helper functions to create and operate with transforms.
  * all functions are non-destructive
  * the "_" version uses non-pointer Transforms. This is slower
@@ -46,7 +46,8 @@ int myround(double x);
  * add_transforms_(mult_transform(&t1, 5.0), &t2) 
  */
 Transform null_transform(void);
-Transform new_transform(double x, double y, double alpha, int extra);
+Transform new_transform(double x, double y, double alpha, 
+                        double zoom, int extra);
 Transform add_transforms(const Transform* t1, const Transform* t2);
 Transform add_transforms_(const Transform t1, const Transform t2);
 Transform sub_transforms(const Transform* t1, const Transform* t2);
@@ -77,6 +78,18 @@ double cleanmean(double* ds, int len);
  */
 Transform cleanmean_xy_transform(const Transform* transforms, int len);
 
+/* calculates the cleaned (cutting of x-th percentil) 
+ * maximum and minimum of an array of transforms,
+ * considerung only x and y
+ */
+void cleanmaxmin_xy_transform(const Transform* transforms, int len,
+                              int percentil, 
+                              Transform* min, Transform* max);
+
+/* helper functions that should be in math.h! */
+
+/* normal round function */
+int myround(double x);
 
 #endif
 
diff --git a/filter/subtitler/Makefile.in b/filter/subtitler/Makefile.in
index eb6f532..d82c2c4 100644
--- a/filter/subtitler/Makefile.in
+++ b/filter/subtitler/Makefile.in
@@ -150,6 +150,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -162,6 +164,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -243,7 +249,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -259,22 +264,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -282,7 +280,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -291,11 +288,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/tomsmocomp/Makefile.in b/filter/tomsmocomp/Makefile.in
index 7b8933b..b774c10 100644
--- a/filter/tomsmocomp/Makefile.in
+++ b/filter/tomsmocomp/Makefile.in
@@ -149,6 +149,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -161,6 +163,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -242,7 +248,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -258,22 +263,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -281,7 +279,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -290,11 +287,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/filter/yuvdenoise/Makefile.in b/filter/yuvdenoise/Makefile.in
index 4a73845..5dd977d 100644
--- a/filter/yuvdenoise/Makefile.in
+++ b/filter/yuvdenoise/Makefile.in
@@ -154,6 +154,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -166,6 +168,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -247,7 +253,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -263,22 +268,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -286,7 +284,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -295,11 +292,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/import/Makefile.am b/import/Makefile.am
index 98bce7e..fa0218f 100644
--- a/import/Makefile.am
+++ b/import/Makefile.am
@@ -171,7 +171,7 @@ import_mp3_la_SOURCES = import_mp3.c
 import_mp3_la_LDFLAGS = -module -avoid-version
 
 import_mpeg2_la_SOURCES = import_mpeg2.c
-import_mpeg2_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMPEG2_CFLAGS)
+import_mpeg2_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMPEG2_CFLAGS) $(LIBMPEG2CONVERT_CFLAGS)
 import_mpeg2_la_LDFLAGS = -module -avoid-version
 
 import_mplayer_la_SOURCES = import_mplayer.c
@@ -328,6 +328,7 @@ tcdecode_LDADD = \
 	$(LZO_LIBS) \
 	$(LIBQUICKTIME_LIBS) \
 	$(LIBMPEG2_LIBS) \
+	$(LIBMPEG2CONVERT_LIBS) \
 	$(OGG_LIBS) \
 	$(THEORA_LIBS) \
 	$(VORBIS_LIBS) \
@@ -345,6 +346,7 @@ tcdecode_CFLAGS = $(AM_CFLAGS) \
 	$(LZO_CFLAGS) \
 	$(LIBQUICKTIME_CFLAGS) \
 	$(LIBMPEG2_CFLAGS) \
+	$(LIBMPEG2CONVERT_CFLAGS) \
 	$(OGG_CFLAGS) \
 	$(THEORA_CFLAGS) \
 	$(VORBIS_CFLAGS)
@@ -579,3 +581,4 @@ tcxpm2rgb_SOURCES = tcxpm2rgb.c
 tcxpm2rgb_LDADD = $(LIBTC_LIBS)
 
 tcxpm2rgb_CFLAGS = $(AM_CFLAGS)
+
diff --git a/import/Makefile.in b/import/Makefile.in
index ce4bf5e..b8b9b97 100644
--- a/import/Makefile.in
+++ b/import/Makefile.in
@@ -294,7 +294,7 @@ tcdecode_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 tcdecode_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(tcdecode_CFLAGS) $(CFLAGS) \
 	$(tcdecode_LDFLAGS) $(LDFLAGS) -o $@
@@ -527,6 +527,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -539,6 +541,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -620,7 +626,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -636,22 +641,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -659,7 +657,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -668,11 +665,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
@@ -781,7 +775,7 @@ import_mov_la_LIBADD = $(LIBQUICKTIME_LIBS) -lm
 import_mp3_la_SOURCES = import_mp3.c
 import_mp3_la_LDFLAGS = -module -avoid-version
 import_mpeg2_la_SOURCES = import_mpeg2.c
-import_mpeg2_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMPEG2_CFLAGS)
+import_mpeg2_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMPEG2_CFLAGS) $(LIBMPEG2CONVERT_CFLAGS)
 import_mpeg2_la_LDFLAGS = -module -avoid-version
 import_mplayer_la_SOURCES = import_mplayer.c
 import_mplayer_la_LDFLAGS = -module -avoid-version
@@ -905,6 +899,7 @@ tcdecode_LDADD = \
 	$(LZO_LIBS) \
 	$(LIBQUICKTIME_LIBS) \
 	$(LIBMPEG2_LIBS) \
+	$(LIBMPEG2CONVERT_LIBS) \
 	$(OGG_LIBS) \
 	$(THEORA_LIBS) \
 	$(VORBIS_LIBS) \
@@ -922,6 +917,7 @@ tcdecode_CFLAGS = $(AM_CFLAGS) \
 	$(LZO_CFLAGS) \
 	$(LIBQUICKTIME_CFLAGS) \
 	$(LIBMPEG2_CFLAGS) \
+	$(LIBMPEG2CONVERT_CFLAGS) \
 	$(OGG_CFLAGS) \
 	$(THEORA_CFLAGS) \
 	$(VORBIS_CFLAGS)
diff --git a/import/decode_mpeg2.c b/import/decode_mpeg2.c
index 0e9820c..4147ae9 100644
--- a/import/decode_mpeg2.c
+++ b/import/decode_mpeg2.c
@@ -30,6 +30,8 @@
 
 #include "libtc/libtc.h"
 
+#if defined(HAVE_LIBMPEG2) && defined(HAVE_LIBMPEG2CONVERT)
+
 #include <mpeg2dec/mpeg2.h>
 #include <mpeg2dec/mpeg2convert.h>
 
@@ -150,6 +152,18 @@ void decode_mpeg2(decode_t *decode)
     import_exit(0);
 }
 
+#else /* defined(HAVE_LIBMPEG2) && defined(HAVE_LIBMPEG2CONVERT) */
+
+void decode_mpeg2(decode_t *decode)
+{
+    tc_log_error(__FILE__, "No support for MPEG2 configured -- exiting");
+    import_exit(1);
+}
+
+
+#endif /* defined(HAVE_LIBMPEG2) && defined(HAVE_LIBMPEG2CONVERT) */
+
+
 /*************************************************************************/
 
 /*
diff --git a/import/demux_pass.c b/import/demux_pass.c
index 4c972fc..d8c5319 100644
--- a/import/demux_pass.c
+++ b/import/demux_pass.c
@@ -31,54 +31,56 @@
 #include "demuxer.h"
 #include "packets.h"
 
+
 int gop, gop_pts, gop_cnt;
 
+/* if you listen carefully, then you can hear the desesperate
+ * whisper of this code calling for a rewrite. Or for a redesign.
+ * Or both. --  FR
+ */
+
 /* ------------------------------------------------------------
  *
  * demuxer pass_through mode
  *
  * ------------------------------------------------------------*/
 
-void tcdemux_pass_through(info_t *ipipe, int *pass)
+void tcdemux_pass_through(info_t *ipipe, int *pass, int npass)
 {
-
-    int k, id=0;
-
-    int j, i, bytes;
-    char *buffer=NULL;
-
-    int payload_id=0, select=PACKAGE_ALL;
-
-    int unit_seek=0, unit, track=0, is_track=0;
-
-    int resync_seq1=0, resync_seq2=INT_MAX, seq_dump, seq_seek;
-    int keep_seq = 0;
-
-    int has_pts_dts=0;
-
+    int bytes, p, id = 0;
+    int i = 0; // packet counter
+    int j = 0; // skipped packets counter
+    int k = 0; // unit counter
+    char *buffer = NULL;
+    int payload_id = 0, select = PACKAGE_ALL;
+    int unit, unit_seek = 0, track = 0, is_track = 0;
+    int resync_seq1       = 0;
+    int resync_seq2       = INT_MAX;
+    int seq_dump          = 0;
+    int seq_seek          = 0;
+    int keep_seq          = 0;
+    int has_pts_dts       = 0;
     int flag_flush        = 0;
+    // will be switched on as soon start of sequences to flush is reached
     int flag_eos          = 0;
     int flag_append_audio = 0;
     int flag_notify       = 1;
-    int flag_avsync       = 1;
+    int flag_avsync       = 0;
     int flag_skip         = 0;
     int flag_sync_reset   = 0;
     int flag_sync_active  = 0;
-
     const char *logfile;
-
-    unsigned int packet_size=VOB_PACKET_SIZE;
-
+    unsigned int pkt_size = VOB_PACKET_SIZE;
     double fps;
 
     // allocate space
-    if((buffer = tc_zalloc(packet_size))==NULL) {
-      tc_log_perror(__FILE__, "out of memory");
-      exit(1);
+    buffer = tc_zalloc(pkt_size);
+    if (!buffer) {
+        tc_log_perror(__FILE__, "out of memory");
+        exit(1);
     }
 
     // copy info parameter to local variables
-
     verbose     = ipipe->verbose;
     unit_seek   = ipipe->ps_unit;
     resync_seq1 = ipipe->ps_seq1;
@@ -89,21 +91,10 @@ void tcdemux_pass_through(info_t *ipipe, int *pass)
     logfile     = ipipe->name;
     keep_seq    = ipipe->keep_seq;
 
-    j=0;  //packet counter
-    i=0;  //skipped packets counter
-    k=0;  //unit counter
-
-    // will be switched on as soon start of sequences to flush is reached
-    flag_flush=0;
-
-    flag_notify=1;
+    if (keep_seq)
+        flag_sync_active=1;
 
-    flag_avsync=0;
-    flag_append_audio=0;
-
-    if(keep_seq) flag_sync_active=1;
-
-    unit=unit_seek;
+    unit = unit_seek;
 
     seq_seek = resync_seq1;
     seq_dump = resync_seq2 - resync_seq1;
@@ -111,191 +102,190 @@ void tcdemux_pass_through(info_t *ipipe, int *pass)
     ++unit_seek;
     ++seq_seek;
 
-    tc_log_msg(__FILE__, "0=0x%x 1=0x%x 2=0x%x 3=0x%x 4=0x%x",
-	       pass[0], pass[1], pass[2], pass[3], pass[4]);
-
-    for(;;) {
-
-
-      /* ------------------------------------------------------------
-       *
-       * (I) read a 2048k block
-       *
-       * ------------------------------------------------------------*/
-
-      if((bytes=tc_pread(ipipe->fd_in, buffer, packet_size)) != packet_size) {
-
-	//program end code?
-	if(bytes==4) {
-	  if(scan_pack_header(buffer, MPEG_PROGRAM_END_CODE)) {
-	    if(verbose & TC_DEBUG)
-	      tc_log_msg(__FILE__, "(pid=%d) program stream end code detected",
-			 getpid());
-	    break;
-	  }
-	}
-
-	if(bytes)
-	  tc_log_warn(__FILE__, "invalid program stream packet size (%d/%d)",
-		      bytes, packet_size);
-
-	break;
-      }
-
-      /* ------------------------------------------------------------
-       *
-       * (II) packet header ok?
-       *
-       * ------------------------------------------------------------*/
-
-
-      if(!scan_pack_header(buffer, TC_MAGIC_VOB)) {
-
-	if(flag_notify && (verbose & TC_DEBUG))
-	  tc_log_warn(__FILE__, "(pid=%d) invalid packet header detected",
-		      getpid());
-
-	// something else?
-
-	if(scan_pack_header(buffer, MPEG_VIDEO) | scan_pack_header(buffer, MPEG_AUDIO)) {
-
-	    if(verbose & TC_STATS)
-		tc_log_msg(__FILE__, "(pid=%d) MPEG system stream detected",
-			   getpid());
-
-	    if(scan_pack_header(buffer, MPEG_VIDEO)) payload_id=PACKAGE_VIDEO;
-	    if(scan_pack_header(buffer, MPEG_AUDIO)) payload_id=PACKAGE_AUDIO_MP3;
-
-	    // no further processing
-	    goto flush_packet;
-	} else {
-
-	    tc_log_warn(__FILE__, "(pid=%d) '0x%02x%02x%02x%02x' not yet supported",
-			getpid(), buffer[0] & 0xff, buffer[1] & 0xff,
-			buffer[2] & 0xff, buffer[3] & 0xff);
-	    break;
-	}
-      } else {
-
-	//MPEG1?
-	if ((buffer[4] & 0xf0) == 0x20) {
-
-	  payload_id=PACKAGE_MPEG1;
-	  flag_flush=1;
-
-	  if(verbose & TC_STATS)
-	    tc_log_msg(__FILE__, "(pid=%d) MPEG-1 video stream detected",
-		       getpid());
-
-	  // no further processing
-	  goto flush_packet;
-	}
-      }
-
-
-      /* ------------------------------------------------------------
-       *
-       * (III) analyze packet contents
-       *
-       * ------------------------------------------------------------*/
-
-
-      // proceed with a valid package, assume defaults
-
-      flag_skip=0;          //do not skip
-      has_pts_dts=0;        //no pts_dts stamp
-      payload_id=0;         //payload unknown
-      flag_sync_reset=0;    //no reset of syncinfo
-
-      id = buffer[17] & 0xff;  //payload id byte
-
-      //MPEG 2?
-      if ((buffer[4] & 0xc0) == 0x40) {
-
-	// do not change any flags
-
-	if(verbose & TC_STATS) {
-	  //display info only once
-	  tc_log_msg(__FILE__, "(pid=%d) MPEG-2 video stream detected",
-		     getpid());
-	}
-      } else {
-
-	//MPEG1
-	if ((buffer[4] & 0xf0) == 0x20) {
-
-	  payload_id=PACKAGE_MPEG1;
-
-	  if(verbose & TC_STATS) {
-	    //display info only once
-	    tc_log_msg(__FILE__, "(pid=%d) MPEG-1 video stream detected",
-		       getpid());
-	  }
-	} else {
-
-	  payload_id=PACKAGE_PASS;
-
-	  if(verbose & TC_DEBUG)
-	    tc_log_warn(__FILE__, "(pid=%d) unknown stream packet id detected",
-			getpid());
-	}
-
-	//flush all MPEG1 stuff
-	goto flush_packet;
-      }
-
-      /* ------------------------------------------------------------
-       *
-       * (IV) audio payload
-       *
-       * ------------------------------------------------------------*/
-
-      // check payload id
-      // process this audio packet?
-
-      // sync to AC3 audio mode?
-      if(id == P_ID_AC3) payload_id = PACKAGE_PRIVATE_STREAM;
-
-      // check for subid here:
-
-      is_track = id;
-
-      if(payload_id == PACKAGE_PRIVATE_STREAM) {
-
-	  //position of track code
-	  uint8_t *_buf=buffer+14;
-	  uint8_t *_tmp=_buf + 9 + _buf[8];
-
-	  is_track = (*_tmp);
-      }
-
-      /* ------------------------------------------------------------
-       *
-       * (VII) evaluate scan results - flush packet
-       *
-       * ------------------------------------------------------------*/
-
-    flush_packet:
-
-      if(is_track == pass[0] || is_track == pass[1] || is_track == pass[2]
-	 || is_track == pass[3] || is_track == pass[4] ) {
-
-	  if(tc_pwrite(ipipe->fd_out, buffer, packet_size) != packet_size) {
-	      tc_log_perror(__FILE__, "write program stream packet");
-	      exit(1);
-	  }
-      }
-
-      //aborting?
-      if(flag_eos) break;
-
-      //total packs (2k each) counter
-      ++j;
+    for (p = 0; p < npass; p++)
+        tc_log_msg(__FILE__, "pass[%i]=0x%x", p, pass[p]);
+
+    for (;;) {
+        /* ------------------------------------------------------------
+         *
+         * (I) read a 2048k block
+         *
+         * ------------------------------------------------------------*/
+
+        bytes = tc_pread(ipipe->fd_in, buffer, pkt_size);
+        if (bytes != pkt_size) {
+            // program end code?
+            if (bytes == 4) {
+                if (scan_pack_header(buffer, MPEG_PROGRAM_END_CODE)) {
+                    if (verbose & TC_DEBUG)
+                        tc_log_msg(__FILE__,
+                                   "(pid=%i) program stream end code found",
+                                   getpid());
+                    break;
+                }
+            }
+
+            if (bytes)
+                tc_log_warn(__FILE__,
+                            "invalid program stream packet size (%i/%i)",
+                            bytes, pkt_size);
+            break;
+        }
+
+        /* ------------------------------------------------------------
+         *
+         * (II) packet header ok?
+         *
+         * ------------------------------------------------------------*/
+
+        if (!scan_pack_header(buffer, TC_MAGIC_VOB)) {
+            if (flag_notify && (verbose & TC_DEBUG))
+                tc_log_warn(__FILE__,
+                            "(pid=%i) invalid packet header detected",
+                            getpid());
+
+            // something else?
+            if (scan_pack_header(buffer, MPEG_VIDEO)
+              | scan_pack_header(buffer, MPEG_AUDIO)) {
+              /* CAUTION: bitwise OR */
+
+                if (verbose & TC_STATS)
+                    tc_log_msg(__FILE__,
+                               "(pid=%i) MPEG system stream detected",
+                               getpid());
+
+                if (scan_pack_header(buffer, MPEG_VIDEO))
+                    payload_id = PACKAGE_VIDEO;
+                if (scan_pack_header(buffer, MPEG_AUDIO))
+                    payload_id = PACKAGE_AUDIO_MP3;
+
+                // no further processing
+                goto flush_packet; /* UGHly */
+            } else {
+                tc_log_warn(__FILE__,
+                            "(pid=%i) '0x%02x%02x%02x%02x' not yet supported",
+                            getpid(), buffer[0] & 0xff, buffer[1] & 0xff,
+                            buffer[2] & 0xff, buffer[3] & 0xff);
+                break;
+            }
+        } else {
+            //MPEG1?
+            if ((buffer[4] & 0xf0) == 0x20) {
+                payload_id = PACKAGE_MPEG1;
+                flag_flush = 1;
+
+                if (verbose & TC_STATS)
+                    tc_log_msg(__FILE__,
+                               "(pid=%i) MPEG-1 video stream detected",
+                               getpid());
+
+                // no further processing
+                goto flush_packet;
+            }
+        }
+
+
+        /* ------------------------------------------------------------
+         *
+         * (III) analyze packet contents
+         *
+         * ------------------------------------------------------------*/
+
+        // proceed with a valid package, assume defaults
+        flag_skip       = 0; // do not skip
+        has_pts_dts     = 0; // no pts_dts stamp
+        payload_id      = 0; // payload unknown
+        flag_sync_reset = 0; // no reset of syncinfo
+
+        id = buffer[17] & 0xff;  //payload id byte
+        //MPEG 2?
+        if ((buffer[4] & 0xc0) == 0x40) {
+            // do not change any flags
+            if (verbose & TC_STATS) {
+                //display info only once
+                tc_log_msg(__FILE__,
+                           "(pid=%i) MPEG-2 video stream detected",
+                           getpid());
+            }
+        } else {
+            // MPEG1
+            if ((buffer[4] & 0xf0) == 0x20) {
+                payload_id = PACKAGE_MPEG1;
+
+                if (verbose & TC_STATS) {
+                    // display info only once
+                    tc_log_msg(__FILE__,
+                               "(pid=%i) MPEG-1 video stream detected",
+                               getpid());
+                }
+            } else {
+                payload_id = PACKAGE_PASS;
+
+                if (verbose & TC_DEBUG)
+                    tc_log_warn(__FILE__,
+                                "(pid=%i) unknown stream packet id detected",
+                                getpid());
+            }
+
+            //flush all MPEG1 stuff
+            goto flush_packet;
+        }
+
+        /* ------------------------------------------------------------
+         *
+         * (IV) audio payload
+         *
+         * ------------------------------------------------------------*/
+
+        // check payload id
+        // process this audio packet?
+
+        // sync to AC3 audio mode?
+        if (id == P_ID_AC3)
+            payload_id = PACKAGE_PRIVATE_STREAM;
+
+        // check for subid here:
+
+        is_track = id;
+
+        if (payload_id == PACKAGE_PRIVATE_STREAM) {
+            //position of track code
+            uint8_t *_buf=buffer + 14;
+            uint8_t *_tmp=_buf + 9 + _buf[8];
+
+            is_track = (*_tmp);
+        }
+
+        /* ------------------------------------------------------------
+         *
+         * (VII) evaluate scan results - flush packet
+         *
+         * ------------------------------------------------------------*/
+
+flush_packet:
+        for (p = 0; p < npass; p++) {
+            if (is_track == pass[p]) {
+                if (tc_pwrite(ipipe->fd_out, buffer, pkt_size) != pkt_size) {
+                    tc_log_perror(__FILE__, "write program stream packet");
+                    exit(1);
+                }
+                break;
+            }
+        }
+        
+        // aborting?
+        if (flag_eos)
+            break;
+
+        //total packs (2k each) counter
+        ++j;
 
     } // process next packet/block
 
-    if(buffer!=NULL) free(buffer);
+    if (buffer != NULL)
+        tc_free(buffer);
 
     return;
 }
 
+
diff --git a/import/demuxer.h b/import/demuxer.h
index 48b5491..299dc73 100644
--- a/import/demuxer.h
+++ b/import/demuxer.h
@@ -62,7 +62,7 @@ int scan_pack_pics(char *video);
 int scan_pack_ext(char *video);
 void scan_pack_payload(char *video, size_t size, int n, int verb);
 
-void tcdemux_pass_through(info_t *ipipe, int *pass);
+void tcdemux_pass_through(info_t *ipipe, int *pass, int npas);
 
 void tcdemux_thread(info_t *ipipe);
 
diff --git a/import/framegen/Makefile.in b/import/framegen/Makefile.in
index 9b16ae9..bcf5a4a 100644
--- a/import/framegen/Makefile.in
+++ b/import/framegen/Makefile.in
@@ -145,6 +145,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -157,6 +159,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -238,7 +244,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -254,22 +259,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -277,7 +275,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -286,11 +283,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/import/nuv/Makefile.in b/import/nuv/Makefile.in
index d30b575..1a2feb0 100644
--- a/import/nuv/Makefile.in
+++ b/import/nuv/Makefile.in
@@ -147,6 +147,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -159,6 +161,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -240,7 +246,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -256,22 +261,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -279,7 +277,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -288,11 +285,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/import/tcdemux.c b/import/tcdemux.c
index 3d2773b..812d7fa 100644
--- a/import/tcdemux.c
+++ b/import/tcdemux.c
@@ -33,8 +33,7 @@
 
 #define MAX_BUF     1024
 
-void tcdemux_pass_through(info_t *ipipe, int *pass);
-int verbose=TC_QUIET;
+int verbose = TC_QUIET;
 
 /* ------------------------------------------------------------
  *
@@ -44,9 +43,9 @@ int verbose=TC_QUIET;
 
 void import_exit(int code)
 {
-  if(verbose & TC_DEBUG)
-    tc_log_msg(EXE, "(pid=%d) exit (code %d)", (int) getpid(), code);
-  exit(code);
+    if (verbose & TC_DEBUG)
+        tc_log_msg(EXE, "(pid=%d) exit (code %d)", (int) getpid(), code);
+    exit(code);
 }
 
 /* ------------------------------------------------------------
@@ -65,28 +64,27 @@ void version(void)
 
 static void usage(int status)
 {
-  version();
-
-  fprintf(stderr,"\nUsage: %s [options]\n", EXE);
-
-  fprintf(stderr,"    -i name          input file name [stdin]\n");
-  fprintf(stderr,"    -t magic         input file type [autodetect]\n");
-  fprintf(stderr,"    -x codec         process only packs with codec payload [all]\n");
-  fprintf(stderr,"    -S unit[,s1-s2]  presentation unit[,s1-s2] sequences [0,all]\n");
-  fprintf(stderr,"    -a ach[,vch]     extract audio[,video] track [0,0]\n");
-  fprintf(stderr,"    -s 0xnn          sync with private substream id 0xnn [off]\n");
-  fprintf(stderr,"    -M mode          demuxer PES A-V sync mode (0=off|1=PTS only|2=full) [1]\n");
-  fprintf(stderr,"    -O               do not skip initial sequence\n");
-  fprintf(stderr,"    -P name          write synchronization data to file\n");
-  fprintf(stderr,"    -W               write navigation data to stdout\n");
-  fprintf(stderr,"    -f fps           frame rate [%.3f]\n", PAL_FPS);
-  fprintf(stderr,"    -d mode          verbosity mode\n");
-  fprintf(stderr,"    -A n[,m[...]]    pass-through packet payload id\n");
-  fprintf(stderr,"    -H               sync hard to supplied fps (no smooth drop)\n");
-  fprintf(stderr,"    -v               print version\n");
-
-  exit(status);
-
+    version();
+
+    fprintf(stderr,"\nUsage: %s [options]\n", EXE);
+
+    fprintf(stderr,"    -i name          input file name [stdin]\n");
+    fprintf(stderr,"    -t magic         input file type [autodetect]\n");
+    fprintf(stderr,"    -x codec         process only packs with codec payload [all]\n");
+    fprintf(stderr,"    -S unit[,s1-s2]  presentation unit[,s1-s2] sequences [0,all]\n");
+    fprintf(stderr,"    -a ach[,vch]     extract audio[,video] track [0,0]\n");
+    fprintf(stderr,"    -s 0xnn          sync with private substream id 0xnn [off]\n");
+    fprintf(stderr,"    -M mode          demuxer PES A-V sync mode (0=off|1=PTS only|2=full) [1]\n");
+    fprintf(stderr,"    -O               do not skip initial sequence\n");
+    fprintf(stderr,"    -P name          write synchronization data to file\n");
+    fprintf(stderr,"    -W               write navigation data to stdout\n");
+    fprintf(stderr,"    -f fps           frame rate [%.3f]\n", PAL_FPS);
+    fprintf(stderr,"    -d mode          verbosity mode\n");
+    fprintf(stderr,"    -A n[,m[...]]    pass-through packet payload id\n");
+    fprintf(stderr,"    -H               sync hard to supplied fps (no smooth drop)\n");
+    fprintf(stderr,"    -v               print version\n");
+
+    exit(status);
 }
 
 
@@ -98,245 +96,216 @@ static void usage(int status)
 
 int main(int argc, char *argv[])
 {
-
     info_t ipipe;
-
-    int user=0, n, demux_mode=TC_DEMUX_SEQ_ADJUST;
-
-    int pass_mode=0, pass[5];
-
-    double fps=PAL_FPS;
-
-    long
-	stream_stype = TC_STYPE_UNKNOWN,
-	stream_codec = TC_CODEC_UNKNOWN,
-	stream_magic = TC_MAGIC_UNKNOWN;
-
-    int ch;
-    char *magic="", *codec=NULL, *name=NULL;
-
-    int keep_initial_seq=0;
-    int hard_fps_flag=0;
-
-    char *logfile=SYNC_LOGFILE;
-
-    int pack_sl=PACKAGE_ALL;
-
-    int a_track=0, v_track=0, subid=0x80;
-
+    int ch, n, user = 0, demux_mode = TC_DEMUX_SEQ_ADJUST;
+    int npass = 0, *pass = NULL, *new_pass = NULL;
+    int keep_initial_seq = 0, hard_fps_flag = 0, pack_sl = PACKAGE_ALL;
+    int unit_seek = 0, resync_seq1 = 0, resync_seq2 = INT_MAX;
+    int a_track = 0, v_track = 0, subid = 0x80;
+    double fps = PAL_FPS;
+    long stream_stype = TC_STYPE_UNKNOWN;
+    long stream_codec = TC_CODEC_UNKNOWN;
+    long stream_magic = TC_MAGIC_UNKNOWN;
+    long x;
+    char *magic = "", *codec = NULL, *name = NULL;
+    char *logfile = SYNC_LOGFILE, *str = NULL, *end = NULL;
     //defaults:
-    int unit_seek=0, resync_seq1=0, resync_seq2=INT_MAX;
-
     //proper initialization
     memset(&ipipe, 0, sizeof(info_t));
 
-    for(n=0; n<5; ++n) pass[n]=0;
-
     libtc_init(&argc, &argv);
 
     while ((ch = getopt(argc, argv, "A:a:d:x:i:vt:S:M:f:P:WHs:O?h")) != -1) {
-
-      switch (ch) {
-
-      case 'i':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	name = optarg;
-
-	break;
-
-      case 'O':
-
-	keep_initial_seq = 1;
-
-	break;
-
-      case 'P':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	logfile = optarg;
-	break;
-
-      case 'S':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-
-	if((n = sscanf(optarg,"%d,%d-%d", &unit_seek, &resync_seq1, &resync_seq2))<0) {
-	  tc_log_error(EXE, "invalid parameter for option -S");
-	  exit(1);
-      }
-
-      if(unit_seek<0) {
-	tc_log_error(EXE, "invalid unit parameter for option -S");
-	usage(EXIT_FAILURE);
-      }
-
-      if(resync_seq1<0 || resync_seq2<0 || resync_seq1>=resync_seq2) {
-	  tc_log_error(EXE, "invalid sequence parameter for option -S");
-	  usage(EXIT_FAILURE);
-      }
-
-      break;
-
-
-      case 'd':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	verbose = atoi(optarg);
-
-	break;
-
-
-      case 'f':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	fps = atof(optarg);
-
-	break;
-
-      case 'W':
-	demux_mode = TC_DEMUX_SEQ_LIST;
-	logfile=NULL;
-	break;
-
-      case 'H':
-	hard_fps_flag = 1;
-	break;
-
-      case 'x':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	codec = optarg;
-
-	if(strcmp(codec,"ac3")==0) {
-	  pack_sl=PACKAGE_AUDIO_AC3;
-	  stream_codec = TC_CODEC_AC3;
-	}
-
-	if(strcmp(codec,"mpeg2")==0) {
-	  pack_sl=PACKAGE_VIDEO;
-	  stream_codec = TC_CODEC_MPEG2;
-	}
-
-	if(strcmp(codec,"mp3")==0) {
-	  pack_sl=PACKAGE_AUDIO_MP3;
-	  stream_codec = TC_CODEC_MP3;
-	}
-
-	if(strcmp(codec,"pcm")==0) {
-	  pack_sl=PACKAGE_AUDIO_PCM;
-	  stream_codec = TC_CODEC_PCM;
-	}
-
-	if(strcmp(codec,"ps1")==0) {
-	  pack_sl=PACKAGE_SUBTITLE;
-	  stream_codec = TC_CODEC_SUB;
-	}
-
-	break;
-
-      case 't':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	magic = optarg;
-	user=1;
-
-	break;
-
-      case 's':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	subid = strtol(optarg, NULL, 16);
-	break;
-
-      case 'A':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-
-	if ((n = sscanf(optarg,"%x,%x,%x,%x,%x", &pass[0], &pass[1], &pass[2], &pass[3], &pass[4]))<=0) {
-	    tc_log_error(EXE, "invalid parameter for option -A");
-	    exit(1);
-	}
-
-	pass_mode=1;
-
-	break;
-
-      case 'M':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-	demux_mode = atoi(optarg);
-
-	if(demux_mode==TC_DEMUX_OFF) verbose=TC_QUIET;
-
-	if(demux_mode<0 || demux_mode>TC_DEMUX_MAX_OPTS) {
-	  tc_log_error(EXE, "invalid parameter for option -M");
-	  exit(1);
-	}
-
-	break;
-
-      case 'a':
-
-	if(optarg[0]=='-') usage(EXIT_FAILURE);
-
-	if ((n = sscanf(optarg,"%d,%d", &a_track, &v_track))<=0) {
-	  tc_log_error(EXE, "invalid parameter for option -a");
-	  exit(1);
-	}
-
-	break;
-
-
-
-      case 'v':
-	version();
-	exit(0);
-	break;
-
-
-      case 'h':
-	usage(EXIT_SUCCESS);
-      default:
-	usage(EXIT_FAILURE);
-      }
+        switch (ch) {
+          case 'i':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            name = optarg;
+            break;
+
+          case 'O':
+            keep_initial_seq = 1;
+            break;
+
+          case 'P':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            logfile = optarg;
+            break;
+
+          case 'S':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            n = sscanf(optarg,"%d,%d-%d",
+                       &unit_seek, &resync_seq1, &resync_seq2);
+            if (n < 0) {
+                tc_log_error(EXE, "invalid parameter for option -S");
+                usage(EXIT_FAILURE);
+            }
+
+            if (unit_seek < 0) {
+                tc_log_error(EXE, "invalid unit parameter for option -S");
+                usage(EXIT_FAILURE);
+            }
+
+            if (resync_seq1 < 0 || resync_seq2 < 0
+             || resync_seq1 >= resync_seq2) {
+                tc_log_error(EXE, "invalid sequence parameter for option -S");
+                usage(EXIT_FAILURE);
+            }
+            break;
+
+          case 'd':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            verbose = atoi(optarg);
+            break;
+
+          case 'f':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            fps = atof(optarg);
+            break;
+
+          case 'W':
+            demux_mode = TC_DEMUX_SEQ_LIST;
+            logfile = NULL;
+            break;
+
+          case 'H':
+            hard_fps_flag = 1;
+            break;
+
+          case 'x':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            codec = optarg;
+
+            if (strcmp(codec,"ac3") == 0) {
+                pack_sl = PACKAGE_AUDIO_AC3;
+                stream_codec = TC_CODEC_AC3;
+            }
+
+            if (strcmp(codec,"mpeg2") == 0) {
+                pack_sl = PACKAGE_VIDEO;
+                stream_codec = TC_CODEC_MPEG2;
+            }
+
+            if (strcmp(codec,"mp3") == 0) {
+                pack_sl = PACKAGE_AUDIO_MP3;
+                stream_codec = TC_CODEC_MP3;
+            }
+
+            if (strcmp(codec,"pcm") == 0) {
+                pack_sl = PACKAGE_AUDIO_PCM;
+                stream_codec = TC_CODEC_PCM;
+            }
+
+            if (strcmp(codec,"ps1") == 0) {
+                pack_sl = PACKAGE_SUBTITLE;
+                stream_codec = TC_CODEC_SUB;
+            }
+            break;
+
+          case 't':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            magic = optarg;
+            user = 1;
+            break;
+
+          case 's':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            subid = strtol(optarg, NULL, 16);
+            break;
+
+          case 'A':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            while (1) {
+                x = strtol(str, &end, 0);
+                if ((end == str) || (x < 1) || (x > 0xff)) {
+                    tc_log_error(EXE, "invalid parameter for option -A");
+                    exit(1);
+                }
+
+                if (*end == '\0') {
+                    break;
+                }
+                if (*end != ',') {
+                    tc_log_error(EXE, "invalid parameter for option -A");
+                    exit(1);
+                }
+                str = end + 1;
+                new_pass = realloc(pass, (npass + 1) * sizeof (int));
+                if (new_pass == NULL) {
+                    tc_log_error(EXE, "out of memory");
+                    exit(1);
+                }
+                pass = new_pass;
+                pass[npass++] = (int)x;
+            }
+            break;
+
+          case 'M':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+            demux_mode = atoi(optarg);
+
+            if (demux_mode == TC_DEMUX_OFF)
+                verbose = TC_QUIET;
+            if (demux_mode < 0 || demux_mode > TC_DEMUX_MAX_OPTS) {
+                tc_log_error(EXE, "invalid parameter for option -M");
+                exit(1);
+            }
+            break;
+
+          case 'a':
+            if (optarg[0] == '-') usage(EXIT_FAILURE);
+
+            if ((n = sscanf(optarg,"%d,%d", &a_track, &v_track)) <= 0) {
+                tc_log_error(EXE, "invalid parameter for option -a");
+                exit(1);
+            }
+            break;
+
+          case 'v':
+            version();
+            exit(0);
+            break;
+
+          case 'h':
+            usage(EXIT_SUCCESS);
+          default:
+            usage(EXIT_FAILURE);
+        }
     }
 
     ac_init(AC_ALL);
 
     /* ------------------------------------------------------------
-     *
      * fill out defaults for info structure
-     *
      * ------------------------------------------------------------*/
 
     // assume defaults
-    if(name==NULL) stream_stype=TC_STYPE_STDIN;
+    if (name == NULL)
+        stream_stype=TC_STYPE_STDIN;
 
     // no autodetection yet
-
-    if(argc==1) {
-      usage(EXIT_FAILURE);
+    if (argc == 1) {
+        usage(EXIT_FAILURE);
     }
 
     // do not try to mess with the stream
-    if(stream_stype!=TC_STYPE_STDIN) {
-
-      if(tc_file_check(name)) exit(1);
-
-      if((ipipe.fd_in = xio_open(name, O_RDONLY))<0) {
-	tc_log_perror(EXE, "open file");
-	exit(1);
-      }
-
-      // try to find out the filetype
-
-      stream_magic=fileinfo(ipipe.fd_in, 0);
-
-      if(verbose)
-	tc_log_msg(EXE, "(pid=%d) %s", getpid(), filetype(stream_magic));
-
-    } else ipipe.fd_in = STDIN_FILENO;
+    if (stream_stype == TC_STYPE_STDIN) {
+        ipipe.fd_in = STDIN_FILENO;
+    } else {
+        if (tc_file_check(name))
+            exit(1);
+
+        ipipe.fd_in = xio_open(name, O_RDONLY);
+        if (ipipe.fd_in < 0) {
+            tc_log_perror(EXE, "open file");
+            exit(1);
+        }
+
+        // try to find out the filetype
+        stream_magic = fileinfo(ipipe.fd_in, 0);
+
+        if (verbose)
+            tc_log_msg(EXE, "(pid=%d) %s", getpid(), filetype(stream_magic));
+    }
 
     // fill out defaults for info structure
     ipipe.fd_out = STDOUT_FILENO;
@@ -364,17 +333,16 @@ int main(int argc, char *argv[])
     //FIXME: video defaults to 0
 
     /* ------------------------------------------------------------
-     *
      * main processing mode
-     *
      * ------------------------------------------------------------*/
 
-    if(pass_mode)
-	tcdemux_pass_through(&ipipe, pass);
+    if (npass > 0)
+        tcdemux_pass_through(&ipipe, pass, npass);
     else
-	tcdemux_thread(&ipipe);
+        tcdemux_thread(&ipipe);
 
-    return(0);
+    return 0;
 }
 
 #include "libtc/static_xio.h"
+
diff --git a/import/v4l/Makefile.am b/import/v4l/Makefile.am
index aead2ce..78c6b1c 100644
--- a/import/v4l/Makefile.am
+++ b/import/v4l/Makefile.am
@@ -8,11 +8,17 @@ AM_CPPFLAGS = \
 
 pkgdir = $(MOD_PATH)
 
+if HAVE_LIBV4L2
+if HAVE_LIBV4LCONVERT
+MOD_V4LCAM = import_v4lcam.la
+endif
+endif
+
 if HAVE_V4L
-MOD = import_v4l.la import_v4l2.la
+MOD_V4LDEV = import_v4l.la import_v4l2.la
 endif
 
-pkg_LTLIBRARIES = $(MOD)
+pkg_LTLIBRARIES = $(MOD_V4LDEV) $(MOD_V4LCAM)
 
 import_v4l_la_SOURCES = import_v4l.c
 import_v4l_la_LDFLAGS = -module -avoid-version
@@ -20,5 +26,10 @@ import_v4l_la_LDFLAGS = -module -avoid-version
 import_v4l2_la_SOURCES = import_v4l2.c
 import_v4l2_la_LDFLAGS = -module -avoid-version
 
+import_v4lcam_la_SOURCES = import_v4lcam.c
+import_v4lcam_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBV4L2_CFLAGS) $(LIBV4LCONVERT_CFLAGS)
+import_v4lcam_la_LDFLAGS = -module -avoid-version
+import_v4lcam_la_LIBADD = $(LIBV4L2_LIBS) $(LIBV4LCONVERT_LIBS)
+
 EXTRA_DIST = videodev.h videodev2.h
 
diff --git a/import/v4l/Makefile.in b/import/v4l/Makefile.in
index 849b11e..c0f4c70 100644
--- a/import/v4l/Makefile.in
+++ b/import/v4l/Makefile.in
@@ -68,6 +68,16 @@ import_v4l2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(import_v4l2_la_LDFLAGS) $(LDFLAGS) -o $@
 @HAVE_V4L_TRUE at am_import_v4l2_la_rpath = -rpath $(pkgdir)
+am__DEPENDENCIES_1 =
+import_v4lcam_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_import_v4lcam_la_OBJECTS = import_v4lcam_la-import_v4lcam.lo
+import_v4lcam_la_OBJECTS = $(am_import_v4lcam_la_OBJECTS)
+import_v4lcam_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(import_v4lcam_la_LDFLAGS) $(LDFLAGS) -o $@
+ at HAVE_LIBV4L2_TRUE@@HAVE_LIBV4LCONVERT_TRUE at am_import_v4lcam_la_rpath =  \
+ at HAVE_LIBV4L2_TRUE@@HAVE_LIBV4LCONVERT_TRUE@	-rpath $(pkgdir)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
 am__depfiles_maybe = depfiles
@@ -80,8 +90,10 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
-SOURCES = $(import_v4l_la_SOURCES) $(import_v4l2_la_SOURCES)
-DIST_SOURCES = $(import_v4l_la_SOURCES) $(import_v4l2_la_SOURCES)
+SOURCES = $(import_v4l_la_SOURCES) $(import_v4l2_la_SOURCES) \
+	$(import_v4lcam_la_SOURCES)
+DIST_SOURCES = $(import_v4l_la_SOURCES) $(import_v4l2_la_SOURCES) \
+	$(import_v4lcam_la_SOURCES)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -152,6 +164,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -164,6 +178,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -245,7 +263,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -261,22 +278,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -284,7 +294,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -293,11 +302,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
@@ -308,12 +314,17 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/import
 
 pkgdir = $(MOD_PATH)
- at HAVE_V4L_TRUE@MOD = import_v4l.la import_v4l2.la
-pkg_LTLIBRARIES = $(MOD)
+ at HAVE_LIBV4L2_TRUE@@HAVE_LIBV4LCONVERT_TRUE at MOD_V4LCAM = import_v4lcam.la
+ at HAVE_V4L_TRUE@MOD_V4LDEV = import_v4l.la import_v4l2.la
+pkg_LTLIBRARIES = $(MOD_V4LDEV) $(MOD_V4LCAM)
 import_v4l_la_SOURCES = import_v4l.c
 import_v4l_la_LDFLAGS = -module -avoid-version
 import_v4l2_la_SOURCES = import_v4l2.c
 import_v4l2_la_LDFLAGS = -module -avoid-version
+import_v4lcam_la_SOURCES = import_v4lcam.c
+import_v4lcam_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBV4L2_CFLAGS) $(LIBV4LCONVERT_CFLAGS)
+import_v4lcam_la_LDFLAGS = -module -avoid-version
+import_v4lcam_la_LIBADD = $(LIBV4L2_LIBS) $(LIBV4LCONVERT_LIBS)
 EXTRA_DIST = videodev.h videodev2.h
 all: all-am
 
@@ -379,6 +390,8 @@ import_v4l.la: $(import_v4l_la_OBJECTS) $(import_v4l_la_DEPENDENCIES)
 	$(import_v4l_la_LINK) $(am_import_v4l_la_rpath) $(import_v4l_la_OBJECTS) $(import_v4l_la_LIBADD) $(LIBS)
 import_v4l2.la: $(import_v4l2_la_OBJECTS) $(import_v4l2_la_DEPENDENCIES) 
 	$(import_v4l2_la_LINK) $(am_import_v4l2_la_rpath) $(import_v4l2_la_OBJECTS) $(import_v4l2_la_LIBADD) $(LIBS)
+import_v4lcam.la: $(import_v4lcam_la_OBJECTS) $(import_v4lcam_la_DEPENDENCIES) 
+	$(import_v4lcam_la_LINK) $(am_import_v4lcam_la_rpath) $(import_v4lcam_la_OBJECTS) $(import_v4lcam_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -388,6 +401,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/import_v4l.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/import_v4l2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/import_v4lcam_la-import_v4lcam.Plo at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -410,6 +424,13 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
+import_v4lcam_la-import_v4lcam.lo: import_v4lcam.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(import_v4lcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT import_v4lcam_la-import_v4lcam.lo -MD -MP -MF $(DEPDIR)/import_v4lcam_la-import_v4lcam.Tpo -c -o import_v4lcam_la-import_v4lcam.lo `test -f 'import_v4lcam.c' || echo '$(srcdir)/'`import_v4lcam.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/import_v4lcam_la-import_v4lcam.Tpo $(DEPDIR)/import_v4lcam_la-import_v4lcam.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='import_v4lcam.c' object='import_v4lcam_la-import_v4lcam.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(import_v4lcam_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o import_v4lcam_la-import_v4lcam.lo `test -f 'import_v4lcam.c' || echo '$(srcdir)/'`import_v4lcam.c
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
diff --git a/import/v4l/import_v4l2.c b/import/v4l/import_v4l2.c
index 6076659..6a50e7e 100644
--- a/import/v4l/import_v4l2.c
+++ b/import/v4l/import_v4l2.c
@@ -927,18 +927,21 @@ static int tc_v4l2_parse_options(V4L2Source *vs, int layout, const char *options
     vs->mute_audio = TC_TRUE; /* for back compatibility and comfort */
 
     switch (layout) {
+      case CODEC_RGB: 
       case TC_CODEC_RGB:
         vs->fmt = IMG_RGB_DEFAULT;
         break;
+      case CODEC_YUV:
       case TC_CODEC_YUV420P:
         vs->fmt = IMG_YUV_DEFAULT;
         break;
+      case CODEC_YUV422:
       case TC_CODEC_YUV422P:
         vs->fmt = IMG_YUV422P;
         break;
       default:
         tc_log_error(MOD_NAME,
-                     "colorspace (%d) must be one of RGB, YUV 4:2:0 or YUV 4:2:2",
+                     "colorspace (0x%X) must be one of RGB, YUV 4:2:0 or YUV 4:2:2",
                      layout);
         return TC_ERROR;
     }
diff --git a/import/v4l/import_v4lcam.c b/import/v4l/import_v4lcam.c
new file mode 100644
index 0000000..2fefb56
--- /dev/null
+++ b/import/v4l/import_v4lcam.c
@@ -0,0 +1,663 @@
+/*
+ * import_v4lcam.c -- imports video frames from v4l2 using libv4l*
+ *                    with special focus on webcams.
+ * (C) 2009 Francesco Romani <fromani at gmail dot com>
+ * based on import_v4l2.c code, which is
+ * (C) Erik Slagter <erik at slagter.name> Sept 2003
+ *
+ * This file is part of transcode, a video stream processing tool.
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define MOD_NAME        "import_v4lcam.so"
+#define MOD_VERSION     "v0.1.0 (2009-08-30)"
+#define MOD_CODEC       "(video) v4l2"
+
+#include "src/transcode.h"
+
+
+static int verbose_flag     = TC_QUIET;
+static int capability_flag  = TC_CAP_RGB|TC_CAP_YUV;
+
+/* 
+ * Briefing
+ *
+ * Q: why a new module?
+ * Q: why don't just enhance import_v4l2?
+ * A: because I want take this chance to do a fresh start with a v4l import
+ *    module, so we can get rid of some old code, try to redesign/rewrite
+ *    it in a better way, experimenting new designes and so on. I want the
+ *    freedom to add special code and special design decisions useful for
+ *    webcams only (or just mostly). import_v4l2 will stay and the experiments
+ *    which time proven to be good will be backported.
+ *    Eventually, v4lcam can be merged into the main v4l module.
+ *
+ * Q: there is some duplicate code with import_v4l2.c. Why?
+ * A: because I'm taking advantage of being a separate module, and because
+ *    I'm experimenting new stuff. After a while, the remaining duplicated
+ *    parts will be merged in a common source.
+ *
+ * Q: why libv4lconvert? We can just extend aclib.
+ * A: no objections of course (but no time either!). However, libv4lconvert
+ *    has IMHO a slightly different focus wrt aclib and I think it's just
+ *    fine to use both of them. As example, the MJPG->I420 conversion
+ *    should NOT enter into aclib (eventually v4lcam can emit MJPG frames
+ *    too, when the module pipeline get enhanced enough).
+
+ */
+
+/*%*
+ *%* DESCRIPTION 
+ *%*   This module allow to capture video frames through a V4L2 (V4L api version 2)
+ *%*   device. This module is specialized for webcam devices.
+ *%*
+ *%* #BUILD-DEPENDS
+ *%*
+ *%* #DEPENDS
+ *%*
+ *%* PROCESSING
+ *%*   import/demuxer
+ *%*
+ *%* MEDIA
+ *%*   video
+ *%*
+ *%* #INPUT
+ *%*
+ *%* OUTPUT
+ *%*   YUV420P, RGB24
+ *%*/
+
+#define MOD_PRE         tc_v4lcam
+#include "import_def.h"
+
+#define _ISOC9X_SOURCE 1
+
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+
+#include <linux/types.h>
+
+// The v4l2_buffer struct check is because some distributions protect that
+// struct in videodev2 with a #ifdef __KERNEL__ (SuSE 9.0)
+
+#if defined(HAVE_LINUX_VIDEODEV2_H) && defined(HAVE_STRUCT_V4L2_BUFFER)
+#define _LINUX_TIME_H
+#include <linux/videodev2.h>
+#else
+#include "videodev2.h"
+#endif
+
+#include "libv4l2.h"
+#include "libv4lconvert.h"
+
+#include "libtc/libtc.h"
+#include "libtc/optstr.h"
+
+#define TC_V4L2_BUFFERS_NUM             (32)
+
+/* TODO: memset() verify and sanitization */
+
+typedef struct tcv4lbuffer TCV4LBuffer;
+struct tcv4lbuffer {
+    void    *start;
+    size_t  length;
+};
+
+typedef struct v4l2source_ V4L2Source;
+
+/* FIXME: naming */
+typedef int (*TCV4LFetchDataFn)(V4L2Source *vs,
+                                uint8_t *src, int src_len,
+                                uint8_t *dst, int dst_len);
+
+struct v4l2source_ {
+    int                     video_fd;
+    int                     video_sequence;
+
+    int                     v4l_dst_csp;
+    struct v4l2_format      v4l_dst_fmt;
+    struct v4l2_format      v4l_src_fmt;
+    struct v4lconvert_data  *v4l_convert;
+    int                     buffers_count;
+
+    int                     width;
+    int                     height;
+
+    TCV4LFetchDataFn        fetch_data;
+    TCV4LBuffer             buffers[TC_V4L2_BUFFERS_NUM];
+};
+
+static int tc_v4l2_fetch_data_memcpy(V4L2Source *vs,
+                                     uint8_t *src, int src_len,
+                                     uint8_t *dst, int dst_len)
+{
+    int ret = TC_ERROR;
+    if (dst_len >= src_len) {
+        ac_memcpy(dst, src, src_len);
+        ret = TC_OK;
+    }
+    return ret;
+}
+
+static int tc_v4l2_fetch_data_v4lconv(V4L2Source *vs,
+                                      uint8_t *src, int src_len,
+                                      uint8_t *dst, int dst_len)
+{
+    int err = v4lconvert_convert(vs->v4l_convert,
+                                 &(vs->v4l_src_fmt),
+                                 &(vs->v4l_dst_fmt),
+                                 src, src_len, dst, dst_len);
+
+    return (err == -1) ?TC_ERROR :TC_OK; /* FIXME */
+}
+
+/* FIXME: reorganize the layout */
+static int tc_v4l2_video_grab_frame(V4L2Source *vs, uint8_t *dest, size_t length)
+{
+    static struct v4l2_buffer buffer; /* FIXME */
+    int ix, err = 0, eio = 0, ret = TC_ERROR;
+
+    // get buffer
+    buffer.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+    buffer.memory = V4L2_MEMORY_MMAP;
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_DQBUF, &buffer);
+    if (err < 0) {
+        tc_log_perror(MOD_NAME,
+                      "error in setup grab buffer (ioctl(VIDIOC_DQBUF) failed)");
+
+        if (errno != EIO) {
+            return TC_OK;
+        } else {
+            eio = 1;
+
+            for (ix = 0; ix < vs->buffers_count; ix++) {
+                buffer.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buffer.memory = V4L2_MEMORY_MMAP;
+                buffer.index  = ix;
+                buffer.flags  = 0;
+
+                err = v4l2_ioctl(vs->video_fd, VIDIOC_DQBUF, &buffer);
+                if (err < 0)
+                    tc_log_perror(MOD_NAME,
+                                  "error in recovering grab buffer (ioctl(DQBUF) failed)");
+            }
+
+            for (ix = 0; ix < vs->buffers_count; ix++) {
+                buffer.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                buffer.memory = V4L2_MEMORY_MMAP;
+                buffer.index  = ix;
+                buffer.flags  = 0;
+
+                err = v4l2_ioctl(vs->video_fd, VIDIOC_QBUF, &buffer);
+                if (err < 0)
+                    tc_log_perror(MOD_NAME,
+                                  "error in recovering grab buffer (ioctl(QBUF) failed)");
+            }
+        }
+    }
+
+    ix  = buffer.index;
+
+    ret = vs->fetch_data(vs,
+                         vs->buffers[ix].start, buffer.bytesused,
+                         dest, length);
+
+    // enqueue buffer again
+    if (!eio) {
+        buffer.type     = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        buffer.memory   = V4L2_MEMORY_MMAP;
+        buffer.flags    = 0;
+
+        err = v4l2_ioctl(vs->video_fd, VIDIOC_QBUF, &buffer);
+        if (err < 0) {
+            tc_log_perror(MOD_NAME, "error in enqueuing buffer (ioctl(VIDIOC_QBUF) failed)");
+            return TC_OK;
+        }
+    }
+
+    return ret;
+}
+
+static int tc_v4l2_video_count_buffers(V4L2Source *vs)
+{
+    struct v4l2_buffer buffer;
+    int ix, ret, buffers_filled = 0;
+
+    for (ix = 0; ix < vs->buffers_count; ix++) {
+        buffer.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        buffer.memory = V4L2_MEMORY_MMAP;
+        buffer.index  = ix;
+
+        ret = v4l2_ioctl(vs->video_fd, VIDIOC_QUERYBUF, &buffer);
+        if (ret < 0) {
+            tc_log_perror(MOD_NAME, 
+                          "error in querying buffers"
+                          " (ioctl(VIDIOC_QUERYBUF) failed)");
+            return -1;
+        }
+
+        if (buffer.flags & V4L2_BUF_FLAG_DONE)
+            buffers_filled++;
+    }
+    return buffers_filled;
+}
+
+static int tc_v4l2_video_check_capabilities(V4L2Source *vs)
+{
+    struct v4l2_capability caps;
+    int err = 0;
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_QUERYCAP, &caps);
+    if (err < 0) {
+        tc_log_error(MOD_NAME, "driver does not support querying capabilities");
+        return TC_ERROR;
+    }
+
+    if (!(caps.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
+        tc_log_error(MOD_NAME, "driver does not support video capture");
+        return TC_ERROR;
+    }
+
+    if (!(caps.capabilities & V4L2_CAP_STREAMING)) {
+        tc_log_error(MOD_NAME, "driver does not support streaming (mmap) video capture");
+        return TC_ERROR;
+    }
+
+    if (verbose_flag > TC_INFO) {
+        tc_log_info(MOD_NAME, "v4l2 video grabbing, driver = %s, device = %s",
+                    caps.driver, caps.card);
+    }
+
+    return TC_OK;
+}
+
+#define pixfmt_to_fourcc(pixfmt, fcc) do { \
+    fcc[0] = (pixfmt >> 0 ) & 0xFF; \
+    fcc[1] = (pixfmt >> 8 ) & 0xFF; \
+    fcc[2] = (pixfmt >> 16) & 0xFF; \
+    fcc[3] = (pixfmt >> 24) & 0xFF; \
+} while (0)
+
+static int tc_v4l2_video_setup_image_format(V4L2Source *vs, int width, int height)
+{
+    int err = 0;
+
+    vs->width  = width;
+    vs->height = height;
+
+    vs->v4l_convert = v4lconvert_create(vs->video_fd);
+    if (!vs->v4l_convert) {
+        return TC_ERROR;
+    }
+
+    memset(&(vs->v4l_dst_fmt), 0, sizeof(vs->v4l_dst_fmt));
+    vs->v4l_dst_fmt.type                = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+    vs->v4l_dst_fmt.fmt.pix.width       = width;
+    vs->v4l_dst_fmt.fmt.pix.height      = height;
+    vs->v4l_dst_fmt.fmt.pix.pixelformat = vs->v4l_dst_csp;
+	
+    err = v4lconvert_try_format(vs->v4l_convert,
+                                &(vs->v4l_dst_fmt), &(vs->v4l_src_fmt));
+    if (err) {
+        tc_log_error(MOD_NAME, "unable to match formats: %s",
+                     v4lconvert_get_error_message(vs->v4l_convert));
+        return TC_ERROR;
+    }
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_S_FMT, &(vs->v4l_src_fmt));
+    if (err < 0) {
+        tc_log_error(MOD_NAME, "error while setting the cam image format");
+        return TC_ERROR;            
+    }
+
+    if (!v4lconvert_needs_conversion(vs->v4l_convert,
+                                    &(vs->v4l_src_fmt),
+                                    &(vs->v4l_dst_fmt))) {
+        tc_log_info(MOD_NAME, "fetch frames directly");
+        vs->fetch_data = tc_v4l2_fetch_data_memcpy;
+        /* Into the near future we should aim for zero-copy. -- FR */
+    } else {
+        char src_fcc[5] = { '\0' };
+        char dst_fcc[5] = { '\0' };
+
+        pixfmt_to_fourcc(vs->v4l_src_fmt.fmt.pix.pixelformat, src_fcc);
+        pixfmt_to_fourcc(vs->v4l_dst_fmt.fmt.pix.pixelformat, dst_fcc);
+
+        tc_log_info(MOD_NAME, "fetch frames using libv4lconvert "
+                              "[%s] -> [%s]",
+                              src_fcc, dst_fcc);
+        vs->fetch_data = tc_v4l2_fetch_data_v4lconv;
+    }
+
+    return TC_OK;
+}
+
+static void tc_v4l2_teardown_image_format(V4L2Source *vs)
+{
+    if (vs->v4l_convert) {
+        v4lconvert_destroy(vs->v4l_convert);
+        vs->v4l_convert = NULL;
+    }
+}
+
+static int tc_v4l2_video_setup_stream_parameters(V4L2Source *vs, int fps)
+{
+    struct v4l2_streamparm streamparm;
+    int err = 0;
+
+    memset(&streamparm, 0, sizeof(streamparm));
+    streamparm.type                                  = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+    streamparm.parm.capture.capturemode              = 0;
+    streamparm.parm.capture.timeperframe.numerator   = 1e7;
+    streamparm.parm.capture.timeperframe.denominator = fps;
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_S_PARM, &streamparm);
+    if (err < 0) {
+        tc_log_warn(MOD_NAME, "driver does not support setting parameters"
+                              " (ioctl(VIDIOC_S_PARM) returns \"%s\")",
+                    errno <= sys_nerr ? sys_errlist[errno] : "unknown");
+    }
+    return TC_OK;
+}
+
+static int tc_v4l2_video_get_capture_buffer_count(V4L2Source *vs)
+{
+    struct v4l2_requestbuffers reqbuf;
+    int err = 0;
+
+    reqbuf.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+    reqbuf.memory = V4L2_MEMORY_MMAP;
+    reqbuf.count  = TC_V4L2_BUFFERS_NUM;
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_REQBUFS, &reqbuf);
+    if (err < 0) {
+        tc_log_perror(MOD_NAME, "VIDIOC_REQBUFS");
+        return TC_ERROR;
+    }
+
+    vs->buffers_count = TC_MIN(reqbuf.count, TC_V4L2_BUFFERS_NUM);
+
+    if (vs->buffers_count < 2) {
+        tc_log_error(MOD_NAME, "not enough buffers for capture");
+        return TC_ERROR;
+    }
+
+    if (verbose_flag > TC_INFO) {
+        tc_log_info(MOD_NAME, "%i buffers available (maximum supported: %i)",
+                    vs->buffers_count, TC_V4L2_BUFFERS_NUM);
+    }
+    return TC_OK;
+}
+
+
+static int tc_v4l2_video_setup_capture_buffers(V4L2Source *vs)
+{
+    struct v4l2_buffer buffer;
+    int ix, err = 0;
+
+    /* map the buffers */
+    for (ix = 0; ix < vs->buffers_count; ix++) {
+        buffer.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        buffer.memory = V4L2_MEMORY_MMAP;
+        buffer.index  = ix;
+
+        err = v4l2_ioctl(vs->video_fd, VIDIOC_QUERYBUF, &buffer);
+        if (err < 0) {
+            tc_log_perror(MOD_NAME, "VIDIOC_QUERYBUF");
+            return TC_ERROR;
+        }
+
+        vs->buffers[ix].length = buffer.length;
+        vs->buffers[ix].start  = v4l2_mmap(0, buffer.length,
+                                           PROT_READ|PROT_WRITE, MAP_SHARED,
+                                           vs->video_fd, buffer.m.offset);
+
+        if (vs->buffers[ix].start == MAP_FAILED) {
+            tc_log_perror(MOD_NAME, "mmap");
+            return TC_ERROR;
+        }
+    }
+
+    /* then enqueue them all */
+    for (ix = 0; ix < vs->buffers_count; ix++) {
+        buffer.type   = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+        buffer.memory = V4L2_MEMORY_MMAP;
+        buffer.index  = ix;
+
+        err = v4l2_ioctl(vs->video_fd, VIDIOC_QBUF, &buffer);
+        if (err < 0) {
+            tc_log_perror(MOD_NAME, "VIDIOC_QBUF");
+            return TC_ERROR;
+        }
+    }
+
+    return TC_OK;
+}
+
+static int tc_v4l2_capture_start(V4L2Source *vs)
+{
+    int err = 0, arg = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_STREAMON, &arg);
+    if (err < 0) {
+        /* ugh, needs VIDEO_CAPTURE */
+        tc_log_perror(MOD_NAME, "VIDIOC_STREAMON");
+        return TC_ERROR;
+    }
+
+    return TC_OK;
+}
+
+static int tc_v4l2_capture_stop(V4L2Source *vs)
+{
+    int err = 0, arg = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
+    err = v4l2_ioctl(vs->video_fd, VIDIOC_STREAMOFF, &arg);
+    if (err < 0) {
+        /* ugh, needs VIDEO_CAPTURE */
+        tc_log_perror(MOD_NAME, "VIDIOC_STREAMOFF");
+        return TC_ERROR;
+    }
+
+    return TC_OK;
+}
+
+static int tc_v4l2_parse_options(V4L2Source *vs, int layout, const char *options)
+{
+    switch (layout) {
+      case CODEC_RGB:
+      case TC_CODEC_RGB:
+        vs->v4l_dst_csp = V4L2_PIX_FMT_RGB24;
+        break;
+      case CODEC_YUV:
+      case TC_CODEC_YUV420P:
+        vs->v4l_dst_csp = V4L2_PIX_FMT_YUV420;
+        break;
+      case CODEC_YUV422:
+      case TC_CODEC_YUV422P:
+        vs->v4l_dst_csp = V4L2_PIX_FMT_YYUV;
+        break;
+      default:
+        tc_log_error(MOD_NAME,
+                     "colorspace (0x%X) must be one of"
+                     " RGB24, YUV 4:2:0 or YUV 4:2:2",
+                     layout);
+        return TC_ERROR;
+    }
+
+    return TC_OK;
+}
+
+/* ============================================================
+ * V4L2 CORE
+ * ============================================================*/
+
+#define RETURN_IF_FAILED(RET) do { \
+    if ((RET) != TC_OK) { \
+        return (RET); \
+    } \
+} while (0)
+
+static int tc_v4l2_video_init(V4L2Source *vs, 
+                           int layout, const char *device,
+                           int width, int height, int fps,
+                           const char *options)
+{
+    int ret = tc_v4l2_parse_options(vs, layout, options);
+    RETURN_IF_FAILED(ret);
+
+    vs->video_fd = v4l2_open(device, O_RDWR, 0);
+    if (vs->video_fd < 0) {
+        tc_log_error(MOD_NAME, "cannot open video device %s", device);
+        return TC_ERROR;
+    }
+
+    ret = tc_v4l2_video_check_capabilities(vs);
+    RETURN_IF_FAILED(ret);
+
+    ret = tc_v4l2_video_setup_image_format(vs, width, height);
+    RETURN_IF_FAILED(ret);
+
+    ret = tc_v4l2_video_setup_stream_parameters(vs, fps);
+    RETURN_IF_FAILED(ret);
+
+    ret = tc_v4l2_video_get_capture_buffer_count(vs);
+    RETURN_IF_FAILED(ret);
+
+    ret = tc_v4l2_video_setup_capture_buffers(vs);
+    RETURN_IF_FAILED(ret);
+
+    return tc_v4l2_capture_start(vs);
+}
+
+static int tc_v4l2_video_get_frame(V4L2Source *vs, uint8_t *data, size_t size)
+{
+    int ret;
+    int buffers_filled = tc_v4l2_video_count_buffers(vs);
+
+    if (buffers_filled == -1) {
+        tc_log_warn(MOD_NAME, "unable to get the capture buffers count," 
+                              " assuming OK");
+        buffers_filled = 0;
+    }
+
+    if (buffers_filled > (vs->buffers_count * 3 / 4)) {
+        tc_log_error(MOD_NAME, "running out of capture buffers (%d left from %d total), "
+                               "stopping capture",
+                               vs->buffers_count - buffers_filled,
+                               vs->buffers_count);
+
+        ret = tc_v4l2_capture_stop(vs);
+    } else {
+        ret = tc_v4l2_video_grab_frame(vs, data, size);
+        vs->video_sequence++;
+    }
+
+    return ret;
+}
+
+static int tc_v4l2_video_grab_stop(V4L2Source *vs)
+{
+    int ix, ret;
+
+    tc_v4l2_teardown_image_format(vs);
+
+    ret = tc_v4l2_capture_stop(vs);
+    RETURN_IF_FAILED(ret);
+
+    for (ix = 0; ix < vs->buffers_count; ix++)
+        v4l2_munmap(vs->buffers[ix].start, vs->buffers[ix].length);
+
+    v4l2_close(vs->video_fd);
+    vs->video_fd = -1;
+
+    return TC_OK;
+}
+
+/* ============================================================
+ * TRANSCODE INTERFACE
+ * ============================================================*/
+
+static V4L2Source VS;
+
+/* ------------------------------------------------------------
+ * open stream
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+    if (param->flag == TC_VIDEO) {
+        if (tc_v4l2_video_init(&VS,
+                               vob->im_v_codec, vob->video_in_file,
+                               vob->im_v_width, vob->im_v_height,
+                               vob->fps, vob->im_v_string)) {
+            return TC_ERROR;
+        }
+    } else {
+        tc_log_error(MOD_NAME, "unsupported request (init)");
+        return TC_ERROR;
+    }
+
+    return TC_OK;
+}
+
+/* ------------------------------------------------------------
+ * decode  stream
+ * ------------------------------------------------------------*/
+
+MOD_decode
+{
+    if (param->flag == TC_VIDEO) {
+        if (tc_v4l2_video_get_frame(&VS, param->buffer, param->size)) {
+            tc_log_error(MOD_NAME, "error in grabbing video");
+            return TC_ERROR;
+        }
+    } else {
+        tc_log_error(MOD_NAME, "unsupported request (decode)");
+        return TC_ERROR;
+    }
+
+    return TC_OK;
+}
+
+/* ------------------------------------------------------------
+ * close stream
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+    if (param->flag == TC_VIDEO) {
+        tc_v4l2_video_grab_stop(&VS);
+    } else {
+        tc_log_error(MOD_NAME, "unsupported request (close)");
+        return TC_ERROR;
+    }
+
+    return TC_OK;
+}
+
+/*************************************************************************/
+
+/*
+ * Local variables:
+ *   c-file-style: "stroustrup"
+ *   c-file-offsets: ((case-label . *) (statement-case-intro . *))
+ *   indent-tabs-mode: nil
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+ */
+
diff --git a/libdldarwin/Makefile.in b/libdldarwin/Makefile.in
index eec325b..51c6e82 100644
--- a/libdldarwin/Makefile.in
+++ b/libdldarwin/Makefile.in
@@ -135,6 +135,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -147,6 +149,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -228,7 +234,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -244,22 +249,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -267,7 +265,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -276,11 +273,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/libtc/Makefile.in b/libtc/Makefile.in
index c4d22ef..bd821a4 100644
--- a/libtc/Makefile.in
+++ b/libtc/Makefile.in
@@ -144,6 +144,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -156,6 +158,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -237,7 +243,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -253,22 +258,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -276,7 +274,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -285,11 +282,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/libtcaudio/Makefile.in b/libtcaudio/Makefile.in
index d9bd3ef..32a6c12 100644
--- a/libtcaudio/Makefile.in
+++ b/libtcaudio/Makefile.in
@@ -133,6 +133,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -145,6 +147,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -226,7 +232,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -242,22 +247,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -265,7 +263,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -274,11 +271,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/libtcvideo/Makefile.in b/libtcvideo/Makefile.in
index 456c803..ef0abbc 100644
--- a/libtcvideo/Makefile.in
+++ b/libtcvideo/Makefile.in
@@ -133,6 +133,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -145,6 +147,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -226,7 +232,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -242,22 +247,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -265,7 +263,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -274,11 +271,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/multiplex/Makefile.in b/multiplex/Makefile.in
index 9b36563..9c248b5 100644
--- a/multiplex/Makefile.in
+++ b/multiplex/Makefile.in
@@ -173,6 +173,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -185,6 +187,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -266,7 +272,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -282,22 +287,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -305,7 +303,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -314,11 +311,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/pvm3/Makefile.in b/pvm3/Makefile.in
index 2df621d..4cb83a9 100644
--- a/pvm3/Makefile.in
+++ b/pvm3/Makefile.in
@@ -156,6 +156,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -168,6 +170,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -249,7 +255,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -265,22 +270,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -288,7 +286,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -297,11 +294,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/src/Makefile.in b/src/Makefile.in
index 220457d..2e6e037 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -149,6 +149,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -161,6 +163,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -242,7 +248,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -258,22 +263,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -281,7 +279,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -290,11 +287,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/src/cmdline_def.h b/src/cmdline_def.h
index 165f7ca..9ae950f 100644
--- a/src/cmdline_def.h
+++ b/src/cmdline_def.h
@@ -117,6 +117,7 @@
 # define TC_OPTION(name,shortopt,argname,helptext,code) \
     { #name, (argname) ? required_argument : no_argument, NULL, OPT_##name },
 # define TC_HEADER(name)  /* nothing */
+# define _TCO_FINI {0,0,0,0}
 #endif
 
 #ifdef TC_OPTIONS_TO_SHORTOPTS
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 5fe30dd..312ea44 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -229,6 +229,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -241,6 +243,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -322,7 +328,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -338,22 +343,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -361,7 +359,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -370,11 +367,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 52ca675..ee41a02 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -210,6 +210,8 @@ LIBDV_CFLAGS = @LIBDV_CFLAGS@
 LIBDV_LIBS = @LIBDV_LIBS@
 LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
 LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
 LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
 LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
 LIBOBJS = @LIBOBJS@
@@ -222,6 +224,10 @@ LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
 LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
 LIBTC_LIBS = @LIBTC_LIBS@
 LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
 LIBXML2_LIBS = @LIBXML2_LIBS@
 LN_S = @LN_S@
@@ -303,7 +309,6 @@ docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 faac_config = @faac_config@
-freetype2_config = @freetype2_config@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -319,22 +324,15 @@ lame_config = @lame_config@
 libavcodec_config = @libavcodec_config@
 libavformat_config = @libavformat_config@
 libdir = @libdir@
-libdv_config = @libdv_config@
 libdvdread_config = @libdvdread_config@
 libexecdir = @libexecdir@
 libjpeg_config = @libjpeg_config@
 libjpegmmx_config = @libjpegmmx_config@
-libmpeg2_config = @libmpeg2_config@
-libpostproc_config = @libpostproc_config@
-libquicktime_config = @libquicktime_config@
-libxml2_config = @libxml2_config@
 localedir = @localedir@
 localstatedir = @localstatedir@
 lzo_config = @lzo_config@
 mandir = @mandir@
-mjpegtools_config = @mjpegtools_config@
 mkdir_p = @mkdir_p@
-ogg_config = @ogg_config@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -342,7 +340,6 @@ program_transform_name = @program_transform_name@
 psdir = @psdir@
 pvm3_config = @pvm3_config@
 sbindir = @sbindir@
-sdl_config = @sdl_config@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
@@ -351,11 +348,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
-theora_config = @theora_config@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-vorbis_config = @vorbis_config@
-x264_config = @x264_config@
 x_includes = @x_includes@
 x_libraries = @x_libraries@
 xvid_config = @xvid_config@

-- 
transcode packaging



More information about the pkg-multimedia-commits mailing list