diff -u --recursive --new-file xawtv-3.24/config.h.in xawtv-3.24-quicktime/config.h.in
--- xawtv-3.24/config.h.in	Sat Oct 21 09:47:19 2000
+++ xawtv-3.24-quicktime/config.h.in	Mon Nov 27 20:55:08 2000
@@ -27,6 +27,9 @@
 /* Define if you have the getpt function.  */
 #undef HAVE_GETPT
 
+/* Define if you have the sched_setscheduler function.  */
+#undef HAVE_SCHED_SETSCHEDULER
+
 /* Define if you have the <endian.h> header file.  */
 #undef HAVE_ENDIAN_H
 
@@ -36,6 +39,12 @@
 /* Define if you have the <sys/soundcard.h> header file.  */
 #undef HAVE_SYS_SOUNDCARD_H
 
+/* Define if you have the efence library (-lefence).  */
+#undef HAVE_LIBEFENCE
+
+/* Define if you have the quicktime library (-lquicktime).  */
+#undef HAVE_LIBQUICKTIME
+
 /* Define if you have the Xdpms library (-lXdpms).  */
 #undef HAVE_LIBXDPMS
 
@@ -47,6 +56,3 @@
 
 /* Define if you have the Xxf86vm library (-lXxf86vm).  */
 #undef HAVE_LIBXXF86VM
-
-/* Define if you have the efence library (-lefence).  */
-#undef HAVE_LIBEFENCE
diff -u --recursive --new-file xawtv-3.24/configure xawtv-3.24-quicktime/configure
--- xawtv-3.24/configure	Mon Nov 13 21:21:46 2000
+++ xawtv-3.24-quicktime/configure	Mon Nov 27 20:56:46 2000
@@ -22,6 +22,8 @@
 ac_help="$ac_help
   --enable-efence         link against ElectricFence (malloc debug)"
 ac_help="$ac_help
+  --enable-quicktime      link against QuickTime for Linux"
+ac_help="$ac_help
   --with-x                use the X Window System"
 
 # Initialize some variables set by options.
@@ -567,13 +569,19 @@
   :
 fi
 
+# Check whether --enable-quicktime or --disable-quicktime was given.
+if test "${enable_quicktime+set}" = set; then
+  enableval="$enable_quicktime"
+  :
+fi
+
 
 
 
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:577: checking for $ac_word" >&5
+echo "configure:585: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -603,7 +611,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:607: checking for $ac_word" >&5
+echo "configure:615: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -654,7 +662,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:658: checking for $ac_word" >&5
+echo "configure:666: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -686,7 +694,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:690: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:698: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -697,12 +705,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 701 "configure"
+#line 709 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -728,12 +736,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:737: checking whether we are using GNU C" >&5
+echo "configure:745: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -742,7 +750,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -761,7 +769,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:765: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:773: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -793,7 +801,7 @@
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:797: checking how to run the C preprocessor" >&5
+echo "configure:805: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -808,13 +816,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 812 "configure"
+#line 820 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -825,13 +833,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 829 "configure"
+#line 837 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -842,13 +850,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 846 "configure"
+#line 854 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -904,7 +912,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:908: checking for a BSD compatible install" >&5
+echo "configure:916: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -961,7 +969,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:965: checking for $ac_word" >&5
+echo "configure:973: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DEPEND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -995,12 +1003,12 @@
 
 
 echo $ac_n "checking for open64""... $ac_c" 1>&6
-echo "configure:999: checking for open64" >&5
+echo "configure:1007: checking for open64" >&5
 if eval "test \"`echo '$''{'ac_cv_func_open64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1004 "configure"
+#line 1012 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char open64(); below.  */
@@ -1023,7 +1031,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_open64=yes"
 else
@@ -1049,12 +1057,12 @@
 for ac_func in ftello getpt getnameinfo
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1053: checking for $ac_func" >&5
+echo "configure:1061: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1058 "configure"
+#line 1066 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1077,7 +1085,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1102,7 +1110,7 @@
 done
 
 cat > conftest.$ac_ext <<EOF
-#line 1106 "configure"
+#line 1114 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 EOF
@@ -1120,17 +1128,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1124: checking for $ac_hdr" >&5
+echo "configure:1132: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1129 "configure"
+#line 1137 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1156,9 +1164,60 @@
 fi
 done
 
+echo $ac_n "checking for sched_setscheduler""... $ac_c" 1>&6
+echo "configure:1169: checking for sched_setscheduler" >&5
+if eval "test \"`echo '$''{'ac_cv_func_sched_setscheduler'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1174 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char sched_setscheduler(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char sched_setscheduler();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_sched_setscheduler) || defined (__stub___sched_setscheduler)
+choke me
+#else
+sched_setscheduler();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_sched_setscheduler=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_sched_setscheduler=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'sched_setscheduler`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_SCHED_SETSCHEDULER 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
 
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1162: checking for pthread_create in -lpthread" >&5
+echo "configure:1221: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1166,7 +1225,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1170 "configure"
+#line 1229 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1177,7 +1236,7 @@
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:1181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1199,7 +1258,7 @@
 
 if test "$LIBPTHREAD" = ""; then
   echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:1203: checking for pthread_create in -lc_r" >&5
+echo "configure:1262: checking for pthread_create in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1207,7 +1266,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1211 "configure"
+#line 1270 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1218,7 +1277,7 @@
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:1222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1240,7 +1299,7 @@
 
 fi
 echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:1244: checking for main in -lossaudio" >&5
+echo "configure:1303: checking for main in -lossaudio" >&5
 ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1248,14 +1307,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lossaudio  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1252 "configure"
+#line 1311 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1276,7 +1335,7 @@
 fi
 
 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:1280: checking for initscr in -lncurses" >&5
+echo "configure:1339: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1284,7 +1343,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1288 "configure"
+#line 1347 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1295,7 +1354,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:1299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1317,7 +1376,7 @@
 
 if test "$LIBCURSES" = ""; then
   echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:1321: checking for initscr in -lcurses" >&5
+echo "configure:1380: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1325,7 +1384,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1329 "configure"
+#line 1388 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1336,7 +1395,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:1340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1372,7 +1431,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1376: checking for X" >&5
+echo "configure:1435: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -1434,12 +1493,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 1438 "configure"
+#line 1497 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1508,14 +1567,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1512 "configure"
+#line 1571 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:1519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -1621,17 +1680,17 @@
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:1625: checking whether -R must be followed by a space" >&5
+echo "configure:1684: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 1628 "configure"
+#line 1687 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -1647,14 +1706,14 @@
       else
 	LIBS="$ac_xsave_LIBS -R $x_libraries"
 	cat > conftest.$ac_ext <<EOF
-#line 1651 "configure"
+#line 1710 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -1686,7 +1745,7 @@
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:1690: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:1749: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1694,7 +1753,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1698 "configure"
+#line 1757 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1705,7 +1764,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1727,7 +1786,7 @@
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:1731: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:1790: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1735,7 +1794,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1739 "configure"
+#line 1798 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1746,7 +1805,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:1750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1775,12 +1834,12 @@
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1779: checking for gethostbyname" >&5
+echo "configure:1838: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1784 "configure"
+#line 1843 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1803,7 +1862,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1824,7 +1883,7 @@
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1828: checking for gethostbyname in -lnsl" >&5
+echo "configure:1887: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1832,7 +1891,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1836 "configure"
+#line 1895 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1843,7 +1902,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:1847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1873,12 +1932,12 @@
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1877: checking for connect" >&5
+echo "configure:1936: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1882 "configure"
+#line 1941 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -1901,7 +1960,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -1922,7 +1981,7 @@
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1926: checking for connect in -lsocket" >&5
+echo "configure:1985: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1930,7 +1989,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1934 "configure"
+#line 1993 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1941,7 +2000,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1965,12 +2024,12 @@
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:1969: checking for remove" >&5
+echo "configure:2028: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 2033 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -1993,7 +2052,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -2014,7 +2073,7 @@
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:2018: checking for remove in -lposix" >&5
+echo "configure:2077: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2022,7 +2081,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2026 "configure"
+#line 2085 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2033,7 +2092,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2057,12 +2116,12 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:2061: checking for shmat" >&5
+echo "configure:2120: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2066 "configure"
+#line 2125 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -2085,7 +2144,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -2106,7 +2165,7 @@
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2110: checking for shmat in -lipc" >&5
+echo "configure:2169: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2114,7 +2173,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2118 "configure"
+#line 2177 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2125,7 +2184,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:2129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2158,7 +2217,7 @@
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:2162: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2221: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2166,7 +2225,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2170 "configure"
+#line 2229 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2177,7 +2236,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2212,7 +2271,7 @@
 
 if test "$enable_xaw3d" != "no"; then
     echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
-echo "configure:2216: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
+echo "configure:2275: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
 ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2220,7 +2279,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXaw3d $X_LIBS $X_PRE_LIBS -lXext -lXmu -lXt -lX11 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2224 "configure"
+#line 2283 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2231,7 +2290,7 @@
 Xaw3dComputeTopShadowRGB()
 ; return 0; }
 EOF
-if { (eval echo configure:2235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2259,7 +2318,7 @@
 
 
 echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
-echo "configure:2263: checking for jpeg_start_compress in -ljpeg" >&5
+echo "configure:2322: checking for jpeg_start_compress in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2267,7 +2326,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ljpeg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2271 "configure"
+#line 2330 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2278,7 +2337,7 @@
 jpeg_start_compress()
 ; return 0; }
 EOF
-if { (eval echo configure:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2306,7 +2365,7 @@
 if test "$enable_efence" = "yes"; then
     echo "*** ElectricFence (malloc debugger) enabled"
     echo $ac_n "checking for EF_Print in -lefence""... $ac_c" 1>&6
-echo "configure:2310: checking for EF_Print in -lefence" >&5
+echo "configure:2369: checking for EF_Print in -lefence" >&5
 ac_lib_var=`echo efence'_'EF_Print | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2314,7 +2373,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lefence  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2318 "configure"
+#line 2377 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2325,7 +2384,7 @@
 EF_Print()
 ; return 0; }
 EOF
-if { (eval echo configure:2329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2354,11 +2413,62 @@
 
 fi
 
+if test "$enable_quicktime" = "yes"; then
+    echo "*** QuickTime enabled"
+    echo $ac_n "checking for quicktime_open in -lquicktime""... $ac_c" 1>&6
+echo "configure:2420: checking for quicktime_open in -lquicktime" >&5
+ac_lib_var=`echo quicktime'_'quicktime_open | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lquicktime  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2428 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char quicktime_open();
+
+int main() {
+quicktime_open()
+; return 0; }
+EOF
+if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo quicktime | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lquicktime $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
 
 LIRC=""
 if test "$enable_lirc" != "no"; then
     echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:2362: checking for lirc_init in -llirc_client" >&5
+echo "configure:2472: checking for lirc_init in -llirc_client" >&5
 ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2366,7 +2476,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-llirc_client  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2370 "configure"
+#line 2480 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2377,7 +2487,7 @@
 lirc_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2406,7 +2516,7 @@
 
 if test "$enable_xfree_ext" != "no"; then
     echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6
-echo "configure:2410: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
+echo "configure:2520: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
 ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2414,7 +2524,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXxf86dga $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2418 "configure"
+#line 2528 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2425,7 +2535,7 @@
 XF86DGAQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:2429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2453,7 +2563,7 @@
 fi
 
     echo $ac_n "checking for XF86VidModeQueryExtension in -lXxf86vm""... $ac_c" 1>&6
-echo "configure:2457: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
+echo "configure:2567: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5
 ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2461,7 +2571,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXxf86vm $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2465 "configure"
+#line 2575 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2472,7 +2582,7 @@
 XF86VidModeQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:2476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2500,7 +2610,7 @@
 fi
 
     echo $ac_n "checking for DPMSQueryExtension in -lXdpms""... $ac_c" 1>&6
-echo "configure:2504: checking for DPMSQueryExtension in -lXdpms" >&5
+echo "configure:2614: checking for DPMSQueryExtension in -lXdpms" >&5
 ac_lib_var=`echo Xdpms'_'DPMSQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2508,7 +2618,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXdpms $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2512 "configure"
+#line 2622 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2519,7 +2629,7 @@
 DPMSQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:2523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2548,7 +2658,7 @@
 
     if test "$ac_cv_lib_Xdpms_DPMSQueryExtension" = "no"; then
 	echo $ac_n "checking for DPMSQueryExtension in -lXext""... $ac_c" 1>&6
-echo "configure:2552: checking for DPMSQueryExtension in -lXext" >&5
+echo "configure:2662: checking for DPMSQueryExtension in -lXext" >&5
 ac_lib_var=`echo Xext'_'DPMSQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2556,7 +2666,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXext $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2560 "configure"
+#line 2670 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2567,7 +2677,7 @@
 DPMSQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2597,7 +2707,7 @@
 
 if test "$enable_xvideo" != "no"; then
     echo $ac_n "checking for XvQueryExtension in -lXv""... $ac_c" 1>&6
-echo "configure:2601: checking for XvQueryExtension in -lXv" >&5
+echo "configure:2711: checking for XvQueryExtension in -lXv" >&5
 ac_lib_var=`echo Xv'_'XvQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2605,7 +2715,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXv $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2609 "configure"
+#line 2719 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2616,7 +2726,7 @@
 XvQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:2620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2648,7 +2758,7 @@
 fi
 
 echo $ac_n "checking for XShmAttach in -lXext""... $ac_c" 1>&6
-echo "configure:2652: checking for XShmAttach in -lXext" >&5
+echo "configure:2762: checking for XShmAttach in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShmAttach | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2656,7 +2766,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXext $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2660 "configure"
+#line 2770 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2667,7 +2777,7 @@
 XShmAttach()
 ; return 0; }
 EOF
-if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
diff -u --recursive --new-file xawtv-3.24/configure.in xawtv-3.24-quicktime/configure.in
--- xawtv-3.24/configure.in	Mon Nov 13 20:20:33 2000
+++ xawtv-3.24-quicktime/configure.in	Mon Nov 27 20:56:42 2000
@@ -18,6 +18,8 @@
   [  --enable-lirc           lirc support])
 AC_ARG_ENABLE(efence,
   [  --enable-efence         link against ElectricFence (malloc debug)])
+AC_ARG_ENABLE(quicktime,
+  [  --enable-quicktime      link against QuickTime for Linux])
 
 
 dnl ---------------------------------------------------------------------
@@ -39,6 +41,7 @@
 AC_CHECK_FUNCS(ftello getpt getnameinfo)
 AC_EGREP_HEADER(sockaddr_storage,sys/socket.h,AC_DEFINE(HAVE_SOCKADDR_STORAGE))
 AC_CHECK_HEADERS(endian.h soundcard.h sys/soundcard.h)
+AC_CHECK_FUNC(sched_setscheduler, AC_DEFINE(HAVE_SCHED_SETSCHEDULER))
 
 AC_CHECK_LIB(pthread,pthread_create,LIBPTHREAD="-lpthread")
 if test "$LIBPTHREAD" = ""; then
@@ -90,6 +93,11 @@
 if test "$enable_efence" = "yes"; then
     echo "*** ElectricFence (malloc debugger) enabled"
     AC_CHECK_LIB(efence, EF_Print)
+fi
+
+if test "$enable_quicktime" = "yes"; then
+    echo "*** QuickTime enabled"
+    AC_CHECK_LIB(quicktime, quicktime_open)
 fi
 
 AC_SUBST(LIRC)
diff -u --recursive --new-file xawtv-3.24/src/Makefile.in xawtv-3.24-quicktime/src/Makefile.in
--- xawtv-3.24/src/Makefile.in	Mon Nov 13 20:21:32 2000
+++ xawtv-3.24-quicktime/src/Makefile.in	Sun Nov 26 09:32:57 2000
@@ -35,7 +35,7 @@
 
 COMMON_OBJS= sound.o grab.o grab-v4l.o grab-v4l2.o grab-bsd.o colorspace.o \
 	webcam.o frequencies.o writefile.o commands.o parseconfig.o mjpeg.o
-CAPTURE_OBJS= capture.o writeavi.o
+CAPTURE_OBJS= capture.o writeavi.o writeqt.o
 LIRC_OBJS=lirc.o
 
 XAWTV_OBJS=  main.o xt.o toolbox.o conf.o x11.o xv.o complete.o wmhooks.o \
@@ -63,7 +63,7 @@
 	$(CC) $(CFLAGS) -o $@ $^ -ljpeg $(LDLIBS)
 
 streamer: streamer.o channel-no-x11.o $(COMMON_OBJS) $(CAPTURE_OBJS)
-	$(CC) $(CFLAGS) -o $@ $^ -ljpeg @LIBPTHREAD@ @LIBSOUND@
+	$(CC) $(CFLAGS) -o $@ $^ @LIBS@ -ljpeg -lpng -lm -lglib @LIBPTHREAD@ @LIBSOUND@
 
 xvideo: xvideo.o
 	$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
diff -u --recursive --new-file xawtv-3.24/src/capture.c xawtv-3.24-quicktime/src/capture.c
--- xawtv-3.24/src/capture.c	Fri Sep 22 21:45:12 2000
+++ xawtv-3.24-quicktime/src/capture.c	Wed Nov 29 17:34:08 2000
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -14,11 +15,15 @@
 #include "grab.h"
 #include "colorspace.h"
 #include "sound.h"
+#include "video.h"
 #include "writeavi.h"
+#include "writeqt.h"
 #include "capture.h"
 
 /*-------------------------------------------------------------------------*/
 
+struct WRITER *writer;
+
 void
 fifo_init(struct FIFO *fifo, char *name, int slots)
 {
@@ -101,8 +106,8 @@
 
 /*-------------------------------------------------------------------------*/
 
-static pthread_mutex_t  avi_lock;
-struct MOVIE_PARAMS     avi_par;
+static pthread_mutex_t  video_lock;
+struct MOVIE_PARAMS     video_par;
 static pthread_t        taudio;
 static pthread_t        tvideo;
 static pthread_t        tflush;
@@ -115,58 +120,60 @@
 static int              caudio,cvideo;
 
 static void*
-avi_audio_writer(void *arg)
+video_audio_writer(void *arg)
 {
     struct FIFO *fifo = arg;
     unsigned char *data;
     int size;
 
     if (debug)
-	fprintf(stderr,"avi_audio_writer start\n");
+	fprintf(stderr,"video_audio_writer start\n");
     for (;;) {
 	size = fifo_get(fifo,&data);
 	if (NULL == data)
 	    break;
-	pthread_mutex_lock(&avi_lock);
-	avi_writesound(data, size);
-	pthread_mutex_unlock(&avi_lock);
+	pthread_mutex_lock(&video_lock);
+	writer->writesound(data, size);
+	pthread_mutex_unlock(&video_lock);
     }
     if (debug)
-	fprintf(stderr,"avi_audio_writer done\n");
+	fprintf(stderr,"video_audio_writer done\n");
     return NULL;
 }
 
 static void *
-avi_video_writer(void *arg)
+video_video_writer(void *arg)
 {
     struct FIFO *fifo = arg;
     unsigned char *data;
     int size;
 
     if (debug)
-	fprintf(stderr,"avi_video_writer start\n");
+	fprintf(stderr,"video_video_writer start\n");
     for (;;) {
 	size = fifo_get(fifo,&data);
 	if (NULL == data)
 	    break;
-	pthread_mutex_lock(&avi_lock);
-	avi_writeframe(data, size);
-	pthread_mutex_unlock(&avi_lock);
+	pthread_mutex_lock(&video_lock);
+	writer->writeframe(data, size);
+	pthread_mutex_unlock(&video_lock);
     }
     if (debug)
-	fprintf(stderr,"avi_video_writer done\n");
+	fprintf(stderr,"video_video_writer done\n");
     return NULL;
 }
 
 int
-avi_init_writer(char *filename, struct MOVIE_PARAMS *params,
-		int slots, int *sound)
+video_init_writer(struct WRITER *w, char *filename, struct MOVIE_PARAMS *params,
+                  int slots, int *sound)
 {
     int linelength;
 
     if (debug)
-	fprintf(stderr,"avi_init_writer\n");
-    pthread_mutex_init(&avi_lock, NULL);
+	fprintf(stderr,"video_init_writer\n");
+    pthread_mutex_init(&video_lock, NULL);
+
+    writer = w;
 
     /* audio */
     *sound = -1;
@@ -174,7 +181,7 @@
 	*sound = sound_open(params);
     if (params->channels > 0) {
 	fifo_init(&faudio,"audio",slots);
-	pthread_create(&taudio,NULL,avi_audio_writer,&faudio);
+	pthread_create(&taudio,NULL,video_audio_writer,&faudio);
 	iaudio = 0;
 	naudio = slots+2;
 	saudio = sound_bufsize();
@@ -186,7 +193,7 @@
     grabber_setparams(params->video_format, &params->width, &params->height,
 		      &linelength,0,0);
     fifo_init(&fvideo,"video",slots);
-    pthread_create(&tvideo,NULL,avi_video_writer,&fvideo);
+    pthread_create(&tvideo,NULL,video_video_writer,&fvideo);
     ivideo = 0;
     nvideo = slots+2;
     svideo = params->width * params->height *
@@ -197,45 +204,45 @@
     cvideo = 0;
     
     /* init */
-    memcpy(&avi_par,params,sizeof(struct MOVIE_PARAMS));
-    avi_open(filename,params);
+    memcpy(&video_par,params,sizeof(struct MOVIE_PARAMS));
+    writer->open(filename,params);
     
     return 0;
 }
 
 int
-avi_start_writer()
+video_start_writer()
 {
     if (debug)
-	fprintf(stderr,"avi_start_writer\n");
+	fprintf(stderr,"video_start_writer\n");
     if (grabber->grab_start)
-	grabber->grab_start(avi_par.fps,0);
-    if (avi_par.channels > 0)
+	grabber->grab_start(video_par.fps,0);
+    if (video_par.channels > 0)
 	sound_startrec();
     pthread_create(&tflush,NULL,flushit,NULL);
     return 0;
 }
 
 int
-avi_stop_writer()
+video_stop_writer()
 {
     void *dummy;
     long long ausec,vusec;
     int soundbytes;
 
     if (debug)
-	fprintf(stderr,"avi_stop_writer\n");
+	fprintf(stderr,"video_stop_writer\n");
 
-    if (avi_par.channels > 0) {
-	vusec = cvideo * 1000 / avi_par.fps;
+    if (video_par.channels > 0) {
+	vusec = cvideo * 1000 / video_par.fps;
 	ausec = ((long long)caudio*saudio*8*1000) /
-	    (avi_par.rate*avi_par.bits*avi_par.channels);
+	    (video_par.rate*video_par.bits*video_par.channels);
 	while (vusec < ausec) {
 	    grab_put_video();
-	    vusec = cvideo * 1000 / avi_par.fps;
+	    vusec = cvideo * 1000 / video_par.fps;
 	}
 	soundbytes = (int)(vusec-ausec)*
-	    avi_par.rate*avi_par.bits*avi_par.channels/8/1000;
+	    video_par.rate*video_par.bits*video_par.channels/8/1000;
 	soundbytes = (soundbytes+4) & ~0x03;
 	fprintf(stderr,"vs=%Ld as=%Ld %d/%d\n",vusec,ausec,
 		soundbytes,saudio);
@@ -248,7 +255,7 @@
     }
 
     /* send EOF + join threads */
-    if (avi_par.channels > 0) {
+    if (video_par.channels > 0) {
 	fifo_put(&faudio,NULL,0);
 	pthread_join(taudio,&dummy);
     }
@@ -258,10 +265,10 @@
     pthread_join(tflush,&dummy);
 
     /* close file */
-    avi_close();
+    writer->close();
     if (grabber->grab_stop)
 	grabber->grab_stop();
-    if (avi_par.channels > 0)
+    if (video_par.channels > 0)
 	sound_close();
     return 0;
 }
diff -u --recursive --new-file xawtv-3.24/src/capture.h xawtv-3.24-quicktime/src/capture.h
--- xawtv-3.24/src/capture.h	Fri Sep 22 21:40:59 2000
+++ xawtv-3.24-quicktime/src/capture.h	Sun Nov 26 09:42:30 2000
@@ -1,6 +1,8 @@
 #ifndef CAPTURE_H
 #define CAPTURE_H
 
+#include "streamer.h"
+
 #define FIFO_MAX 64
 
 struct FIFO {
@@ -16,10 +18,10 @@
 int fifo_put(struct FIFO *fifo, unsigned char *data, int size);
 int fifo_get(struct FIFO *fifo, unsigned char **data);
 
-int avi_init_writer(char *filename, struct MOVIE_PARAMS *params,
-		    int slots, int *sound);
-int avi_start_writer(void);
-int avi_stop_writer(void);
+int video_init_writer(struct WRITER *w, char *filename, 
+                    struct MOVIE_PARAMS *params, int slots, int *sound);
+int video_start_writer(void);
+int video_stop_writer(void);
 
 int generic_init_writer(void* (*video_writer)(void *arg),
 			int format, int *width, int *height, int slots);
diff -u --recursive --new-file xawtv-3.24/src/grab.c xawtv-3.24-quicktime/src/grab.c
--- xawtv-3.24/src/grab.c	Sat Nov  4 17:56:19 2000
+++ xawtv-3.24-quicktime/src/grab.c	Tue Nov 28 18:10:44 2000
@@ -166,6 +166,7 @@
     { VIDEO_GRAY,     1, gray_to_lut2    },
     { -1,0, NULL }
 };
+
 static struct CONV_LIST rgb16_le_list[] = {
     { VIDEO_RGB16_BE, 0, byteswap_short  },
     { VIDEO_RGB24,    1, rgb24_to_lut2   },
@@ -257,7 +258,6 @@
     { VIDEO_BGR24,   0, mjpg_bgr_compress,    mjpg_rgb_init, mjpg_cleanup },
     { -1,0, NULL }
 };
-
 
 static struct CONV_LIST *conv_lists[] = {
     NULL  /* unused      */,
diff -u --recursive --new-file xawtv-3.24/src/grab.h xawtv-3.24-quicktime/src/grab.h
--- xawtv-3.24/src/grab.h	Sun Aug 27 15:50:45 2000
+++ xawtv-3.24-quicktime/src/grab.h	Wed Nov 29 17:32:57 2000
@@ -29,7 +29,7 @@
 #define GRAB_ATTR_HUE       13
 #define GRAB_ATTR_CONTRAST  14
 
-#define TRAP(txt) fprintf(stderr,"%s:%d:%s\n",__FILE__,__LINE__,txt);exit(1);
+#define TRAP(txt) { fprintf(stderr,"%s:%d:%s\n",__FILE__,__LINE__,txt);exit(1); }
 
 /* ------------------------------------------------------------------------- */
 
diff -u --recursive --new-file xawtv-3.24/src/main.c xawtv-3.24-quicktime/src/main.c
--- xawtv-3.24/src/main.c	Sat Nov  4 18:00:31 2000
+++ xawtv-3.24-quicktime/src/main.c	Sun Nov 26 10:06:07 2000
@@ -98,6 +98,8 @@
 /* what we are using for floating point X resources */
 typedef float fp_res;
 
+extern struct WRITER write_avi;
+
 /*--- public variables ----------------------------------------------------*/
 
 Widget            opt_shell, opt_paned, chan_shell, conf_shell, str_shell;
@@ -1976,8 +1978,8 @@
 	    params.rate         = 44100;
 	}
 
-	avi_init_writer(filename, &params, 16, &sound);
-	avi_start_writer();
+	video_init_writer(&write_avi, filename, &params, 16, &sound);
+	video_start_writer();
 	rec_work_id  = XtAppAddWorkProc(app_context,rec_work,NULL);
 	if (-1 != sound)
 	    rec_audio_id = XtAppAddInput(app_context,sound,
@@ -1992,7 +1994,7 @@
 	if (0 == cur_movie)
 	    return; /* nothing to stop here */
 
-	avi_stop_writer();
+	video_stop_writer();
 	XtRemoveWorkProc(rec_work_id);
 	rec_work_id = 0;
 	if (rec_audio_id) {
diff -u --recursive --new-file xawtv-3.24/src/sound.c xawtv-3.24-quicktime/src/sound.c
--- xawtv-3.24/src/sound.c	Sun Nov  5 11:49:32 2000
+++ xawtv-3.24-quicktime/src/sound.c	Wed Nov 29 19:43:23 2000
@@ -15,6 +15,7 @@
 
 #include "writeavi.h"
 #include "sound.h"
+#include "video.h"
 
 /* -------------------------------------------------------------------- */
 
@@ -44,9 +45,10 @@
     /* format */
     switch (params->bits) {
     case 16:
-	afmt = AFMT_S16_LE;
+	afmt = params->encap == VIDEO_AVI ? AFMT_S16_LE : AFMT_S16_BE;
 	ioctl(fd, SNDCTL_DSP_SETFMT, &afmt);
-	if (afmt == AFMT_S16_LE)
+	if (afmt == 
+	    (params->encap == VIDEO_AVI ? AFMT_S16_LE : AFMT_S16_BE))
 	    break;
 	fprintf(stderr,"no 16 bit sound, trying 8 bit...\n");
 	params->bits = 8;
diff -u --recursive --new-file xawtv-3.24/src/sound.h xawtv-3.24-quicktime/src/sound.h
--- xawtv-3.24/src/sound.h	Sat Mar 11 13:32:20 2000
+++ xawtv-3.24-quicktime/src/sound.h	Sun Nov 26 09:48:02 2000
@@ -1,4 +1,4 @@
-#include "writeavi.h"
+#include "video.h"
 
 int   sound_open(struct MOVIE_PARAMS *params);
 int   sound_bufsize(void);
diff -u --recursive --new-file xawtv-3.24/src/streamer.c xawtv-3.24-quicktime/src/streamer.c
--- xawtv-3.24/src/streamer.c	Sat Sep  2 20:39:35 2000
+++ xawtv-3.24-quicktime/src/streamer.c	Wed Nov 29 17:33:56 2000
@@ -24,7 +24,11 @@
 #include <sys/ipc.h>
 #include <sys/wait.h>
 #include <X11/Intrinsic.h>
+#ifdef HAVE_LIBQUICKTIME
+#include <quicktime/quicktime.h>
+#endif
 
+#include "streamer.h"
 #include "colorspace.h"
 #include "writefile.h"
 #include "writeavi.h"
@@ -34,9 +38,14 @@
 #include "capture.h"
 #include "commands.h"
 
+extern struct WRITER write_qt;
+extern struct WRITER write_avi;
+
 struct GRAB_FORMAT {
     char *name;
     int  bt848;
+    char *codec;
+    encap_t encap;
     int  mul,div;
     int  can_stdout;
     int  can_singlefile;
@@ -45,24 +54,37 @@
 
 static struct GRAB_FORMAT formats[] = {
     /* file formats */
-    { "ppm",  VIDEO_RGB24,     3,1,  0,0,1 },
-    { "pgm",  VIDEO_GRAY,      1,1,  0,0,1 },
-    { "jpeg", VIDEO_RGB24,     3,1,  0,0,1 },
+    { "ppm",     VIDEO_RGB24,    NULL,          VIDEO_OTHER,     3,1,  0,0,1 },
+    { "pgm",     VIDEO_GRAY,     NULL,          VIDEO_OTHER,     1,1,  0,0,1 },
+    { "jpeg",    VIDEO_RGB24,    NULL,          VIDEO_OTHER,     3,1,  0,0,1 },
 
     /* video */
-    { "avi15",VIDEO_RGB15_LE,  2,1,  0,1,0 },
-    { "avi24",VIDEO_BGR24,     3,1,  0,1,0 },
-    { "mjpeg",VIDEO_MJPEG,     0,1,  0,1,0 },
+    { "avi15",   VIDEO_RGB15_LE, NULL,          VIDEO_AVI,       2,1,  0,1,0 },
+    { "avi24",   VIDEO_BGR24,    NULL,          VIDEO_AVI,       3,1,  0,1,0 },
+    { "mjpeg",   VIDEO_MJPEG,    NULL,          VIDEO_AVI,       0,1,  0,1,0 },
+
+#ifdef HAVE_LIBQUICKTIME
+    /* QuickTime */
+    { "qt_dv",   VIDEO_RGB24,   QUICKTIME_DV,   VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_raw",  VIDEO_RGB24,   QUICKTIME_RAW,  VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_jpeg", VIDEO_RGB24,   QUICKTIME_JPEG, VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_mjpa", VIDEO_RGB24,   QUICKTIME_MJPA, VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_yuv9", VIDEO_RGB24,   QUICKTIME_YUV9, VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_rtj0", VIDEO_RGB24,   QUICKTIME_RTJ0, VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_yuv2", VIDEO_RGB24,   QUICKTIME_YUV2, VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_yuv4", VIDEO_RGB24,   QUICKTIME_YUV4, VIDEO_QUICKTIME, 3,1,  0,1,0 },
+    { "qt_png",  VIDEO_RGB24,   QUICKTIME_PNG,  VIDEO_QUICKTIME, 3,1,  0,1,0 },
+#endif
 
     /* raw data */
-    { "rgb",  VIDEO_RGB24,     3,1,  1,1,1 },
-    { "gray", VIDEO_GRAY,      1,1,  1,1,1 },
-    { "422",  VIDEO_YUV422,    2,1,  1,1,1 },
-    { "422p", VIDEO_YUV422P,   2,1,  1,1,1 },
-    { "420p", VIDEO_YUV420P,   3,2,  1,1,1 },
+    { "rgb",     VIDEO_RGB24,   NULL,           VIDEO_OTHER,     3,1,  1,1,1 },
+    { "gray",    VIDEO_GRAY,    NULL,           VIDEO_OTHER,     1,1,  1,1,1 },
+    { "422",     VIDEO_YUV422,  NULL,           VIDEO_OTHER,     2,1,  1,1,1 },
+    { "422p",    VIDEO_YUV422P, NULL,           VIDEO_OTHER,     2,1,  1,1,1 },
+    { "420p",    VIDEO_YUV420P, NULL,           VIDEO_OTHER,     3,2,  1,1,1 },
 
     /* end of table */
-    { NULL,   0,               0,0,  0 },
+    { NULL,      0,             NULL,           0,0,  0,0,0 },
 };
 
 /* ---------------------------------------------------------------------- */
@@ -77,6 +99,9 @@
 
 static int  single = 1, format = -1, absframes = 1, with_audio = 0, gray = 0;
 static int  fd = -1, width = 320, height = 240, quiet = 0, fps = 30;
+#ifdef HAVE_SCHED_SETSCHEDULER
+static int  realtime = 0;
+#endif
 
 static int  signaled = 0, linelength = 0, wait_seconds = 0;
 
@@ -100,21 +125,25 @@
 	    "\n"
 	    "options:\n"
 	    "  -q          quiet operation\n"
-	    "  -a m|s      audio recording mono/stereo [off]\n"
+	    "  -a m|s      audio recording mono/stereo  [off]\n"
 	    "              (avi movies only).  Check the record source with\n"
 	    "              some mixer tool if you get silence.\n"
-	    "  -c device   specify device              [%s]\n"
-	    "  -f format   specify output format       [%s]\n"
-	    "  -s size     specify size                [%dx%d]\n"
-	    "  -b buffers  specify # of buffers        [%d]\n"
-	    "  -t times    number of frames            [%d]\n"
-	    "  -r fps      frame rate                  [%d]\n"
-	    "  -o file     output file name            [%s]\n"
-	    "  -n tvnorm   set pal/ntsc/secam          [no change]\n"
-	    "  -i input    set input source (int)      [no change]\n"
-	    "  -j quality  quality for mjpeg or jpeg   [%d]\n"
-	    "  -g          convert to grayscale (jpeg) [%s]\n"
-	    "  -w seconds  wait before grabbing        [%d]\n"
+	    "  -c device   specify device               [%s]\n"
+	    "  -f format   specify output format        [%s]\n"
+	    "  -s size     specify size                 [%dx%d]\n"
+	    "  -b buffers  specify # of buffers         [%d]\n"
+	    "  -t times    number of frames             [%d]\n"
+	    "  -r fps      frame rate                   [%d]\n"
+	    "  -o file     output file name             [%s]\n"
+	    "  -n tvnorm   set pal/ntsc/secam           [no change]\n"
+	    "  -i input    set input source (int)       [no change]\n"
+	    "  -j quality  quality for mjpeg or jpeg    [%d]\n"
+	    "  -g          convert to grayscale (jpeg)  [%s]\n"
+	    "  -w seconds  wait before grabbing         [%d]\n"
+#ifdef HAVE_SCHED_SETSCHEDULER
+	    "  -e          use soft realtime scheduling [%s]\n"
+#endif
+	    "  -d          print debugging messages     [%s]\n"
 	    "\n"
 	    "If the filename has some digits, %s will write multiple files,\n"
 	    "otherwise one huge file.  Writing to one file works with raw\n"
@@ -131,9 +160,11 @@
 	    "\n"
 #endif
 	    "formats:\n"
-	    "  raw data:      rgb, gray, 422, 422p, 420p\n"
-	    "  file formats:  ppm, pgm, jpeg\n"
-	    "  movie formats: avi15, avi24, mjpeg\n"
+	    "  raw data:          rgb, gray, 422, 422p, 420p\n"
+	    "  file formats:      ppm, pgm, jpeg\n"
+	    "  movie formats:     avi15, avi24, mjpeg\n"
+	    "  QuickTime formats: qt_dv, qt_raw, qt_jpeg, qt_mjpa, qt_yuv9,\n"
+	    "                     qt_rtj0, qt_yuv2, qt_yuv4, qt_png\n"
 	    "\n"
 	    "examples:\n"
 	    "  %s -o image.ppm                             write single ppm file\n"
@@ -148,7 +179,11 @@
 	    filename ? filename : "stdout",
 	    jpeg_quality,
 	    gray ? "yes" : "no",
-	    wait_seconds,
+	    wait_seconds, 
+#ifdef HAVE_SCHED_SETSCHEDULER
+	    realtime ? "yes" : "no",
+#endif
+	    debug ? "yes" : "no",
 	    prog, prog, prog, prog, prog);
 }
 
@@ -261,7 +296,7 @@
 
     /* parse options */
     for (;;) {
-	if (-1 == (c = getopt(argc, argv, "hqda:f:s:c:o:b:t:r:n:i:y:j:w:g")))
+	if (-1 == (c = getopt(argc, argv, "hqda:f:s:c:o:b:t:r:n:i:y:j:w:ge")))
 	    break;
 	switch (c) {
 	case 'q':
@@ -340,6 +375,11 @@
 	case 'g':
 	    gray = 1;
 	    break;
+#ifdef HAVE_SCHED_SETSCHEDULER
+	case 'e':
+	    realtime = 1;
+	    break;
+#endif
 	case 'h':
 	default:
 	    usage(argv[0]);
@@ -404,10 +444,12 @@
      */
 
     /* start up writer */
-    if (format >= 3 && format <= 5) {
+    if (formats[format].encap != VIDEO_OTHER) {
 	struct MOVIE_PARAMS params;
 	memset(&params,0,sizeof(params));
 	params.video_format = formats[format].bt848;
+	params.codec = formats[format].codec;
+	params.encap = formats[format].encap;
         params.width        = width;
         params.height       = height;
         params.fps          = fps;
@@ -416,14 +458,28 @@
             params.channels     = with_audio;
             params.rate         = 44100;
         }
-	avi_init_writer(filename, &params, bufcount, &sound);
-	avi_start_writer();
-	
+	switch (formats[format].encap) {
+	    case VIDEO_AVI:
+	        video_init_writer(&write_avi, filename, &params, bufcount, 
+		                  &sound);
+		break;
+#ifdef HAVE_LIBQUICKTIME
+	    case VIDEO_QUICKTIME:
+	        video_init_writer(&write_qt, filename, &params, bufcount, 
+		                  &sound);
+		break;
+#endif
+	    default:
+	        fprintf(stderr, "unsupported codec\n");
+		exit(1);
+	}
+	video_start_writer();
+
     } else if (single && formats[format].can_singlefile) {
 	generic_init_writer(writer_single, formats[format].bt848,
 			    &width, &height, bufcount);
 	generic_start_writer(fps);
-	
+
     } else {
 	generic_init_writer(writer_files, formats[format].bt848,
 			    &width, &height, bufcount);
@@ -438,6 +494,19 @@
     /* catch ^C */
     signal(SIGINT,ctrlc);
 
+/* FIXME: Put sched_setscheduler call here?  Only the process
+reading from the video device should have a realtime priority,
+and this process should make no system calls except read/write. */
+#ifdef HAVE_SCHED_SETSCHEDULER
+    if (realtime) {
+	struct sched_param p;
+	sched_getparam (0, &p);
+	p.sched_priority = sched_get_priority_max(SCHED_FIFO);
+        if (sched_setscheduler(0, SCHED_FIFO, &p))
+	    fprintf(stderr, "setting realtime priority failed\n");
+    }
+#endif
+
     /* main loop */
     for (;queued < absframes && !signaled; count++) {
 	/* audio */
@@ -461,8 +530,8 @@
     }
 
     /* stop */
-    if (format >= 3 && format <= 5) {
-	avi_stop_writer();
+    if (format >= 3 && format <= 14) {
+	video_stop_writer();
     } else {
 	generic_stop_writer();
     }	
diff -u --recursive --new-file xawtv-3.24/src/streamer.h xawtv-3.24-quicktime/src/streamer.h
--- xawtv-3.24/src/streamer.h	Thu Jan  1 01:00:00 1970
+++ xawtv-3.24-quicktime/src/streamer.h	Sun Nov 26 09:48:13 2000
@@ -0,0 +1,14 @@
+#ifndef STREAMER_H
+#define STREAMER_H 1
+
+#include "video.h"
+
+struct WRITER {
+    char *name;
+    int (*open)(char *filename, struct MOVIE_PARAMS *par);
+    int (*writeframe)(void *data, int datasize);
+    int (*writesound)(void *data, int datasize);
+    int (*close)(void);
+};
+
+#endif
diff -u --recursive --new-file xawtv-3.24/src/video.h xawtv-3.24-quicktime/src/video.h
--- xawtv-3.24/src/video.h	Thu Jan  1 01:00:00 1970
+++ xawtv-3.24-quicktime/src/video.h	Tue Nov 28 17:29:18 2000
@@ -0,0 +1,23 @@
+#ifndef MOVIE_H
+#define MOVIE_H 1
+
+typedef enum {
+    VIDEO_AVI,
+    VIDEO_QUICKTIME,
+    VIDEO_OTHER
+} encap_t;
+
+struct MOVIE_PARAMS {
+    /* video */
+    int video_format;
+    char *codec;                /* codec used for QuickTime */
+    encap_t encap;
+    int width, height;          /* size */
+    int fps;                    /* frames per second */
+    /* audio */
+    int channels;               /* 1 = mono, 2 = stereo */
+    int bits;                   /* 8/16 */
+    int rate;                   /* sample rate (11025 etc) */
+};
+
+#endif
diff -u --recursive --new-file xawtv-3.24/src/writeavi.c xawtv-3.24-quicktime/src/writeavi.c
--- xawtv-3.24/src/writeavi.c	Tue Aug 22 20:27:50 2000
+++ xawtv-3.24-quicktime/src/writeavi.c	Wed Nov 29 17:33:06 2000
@@ -8,6 +8,7 @@
 #include "grab.h"
 #include "writeavi.h"
 #include "colorspace.h"
+#include "streamer.h"
 
 /*
  * M$ vidcap avi video+audio layout
@@ -36,7 +37,6 @@
 
 /* ----------------------------------------------------------------------- */
 
-#define TRAP(txt) fprintf(stderr,"%s:%d:%s\n",__FILE__,__LINE__,txt);exit(1);
 #define PERROR(action,file) \
   {fprintf(stderr,"%s: %s: %s\n",action,file,strerror(errno));return -1;}
 
@@ -48,6 +48,14 @@
 
 typedef unsigned int   uint32;
 typedef unsigned short uint16;
+
+struct WRITER write_avi = {
+    "avi",
+    avi_open,
+    avi_writeframe,
+    avi_writesound,
+    avi_close
+};
 
 struct RIFF_avih {
     uint32 us_frame;          /* microsec per frame */
diff -u --recursive --new-file xawtv-3.24/src/writeavi.h xawtv-3.24-quicktime/src/writeavi.h
--- xawtv-3.24/src/writeavi.h	Tue Aug 22 20:30:19 2000
+++ xawtv-3.24-quicktime/src/writeavi.h	Sun Nov 26 09:48:38 2000
@@ -5,17 +5,7 @@
 # include <endian.h>
 #endif
 #include "byteorder.h"
-
-struct MOVIE_PARAMS {
-    /* video */
-    int video_format;
-    int width, height;          /* size */
-    int fps;                    /* frames per second */
-    /* audio */
-    int channels;               /* 1 = mono, 2 = stereo */
-    int bits;                   /* 8/16 */
-    int rate;                   /* sample rate (11025 etc) */
-};
+#include "video.h"
 
 int avi_open(char *filename, struct MOVIE_PARAMS *par);
 int avi_writeframe(void *data, int datasize);
diff -u --recursive --new-file xawtv-3.24/src/writeqt.c xawtv-3.24-quicktime/src/writeqt.c
--- xawtv-3.24/src/writeqt.c	Thu Jan  1 01:00:00 1970
+++ xawtv-3.24-quicktime/src/writeqt.c	Wed Nov 29 19:54:37 2000
@@ -0,0 +1,93 @@
+#include "config.h"
+
+#include "writeqt.h"
+#include <stdlib.h>
+#include <stdio.h>
+#ifdef HAVE_LIBQUICKTIME
+#include <quicktime/quicktime.h>
+#endif
+#include "grab.h"
+#include "streamer.h"
+
+#ifdef HAVE_LIBQUICKTIME
+static quicktime_t *qt_fd;
+static unsigned char **qt_row_pointers;
+static int qt_width, qt_height, qt_depth, qt_row_size, qt_channels, qt_bits;
+static int qt_sample_size;
+#endif
+
+struct WRITER write_qt = {
+    "qt",
+    qt_open,
+    qt_writeframe,
+    qt_writesound,
+    qt_close
+};
+
+int
+qt_open(char *filename, struct MOVIE_PARAMS *par)
+{
+#ifdef HAVE_LIBQUICKTIME
+    qt_width = par->width;
+    qt_height = par->height;
+    qt_depth = format2depth[par->video_format];
+    qt_row_size = qt_width * qt_depth / 8;
+    qt_channels = par->channels;
+    qt_bits = par->bits;
+    qt_sample_size = qt_channels * (qt_bits == 16 ? 2 : 1);
+    qt_row_pointers = (unsigned char **) malloc (sizeof (unsigned char *) 
+                       * par->height);
+    qt_fd = quicktime_open(filename,0,1);
+    
+    /* Should read data from sound card using AFMT_U8 and AFMT_S16_BE */
+    /* for QUICKTIME_RAW and QUICKTIME_TWOS. */
+    quicktime_set_audio(qt_fd,par->channels,par->rate,par->bits,
+                        par->bits == 8 ? QUICKTIME_RAW : QUICKTIME_TWOS);
+
+    quicktime_set_video(qt_fd,1,par->width,par->height,par->fps,par->codec);
+    if (! quicktime_supported_video(qt_fd, 0))
+        TRAP("video codec not supported");
+    if (! quicktime_supported_audio(qt_fd, 0))
+        TRAP("audio codec not supported");
+    quicktime_set_info(qt_fd, "Generated with streamer, (C) 2000 Gerd Knorr");
+    return 0;
+#else
+    TRAP("QuickTime support not compiled in");
+    exit (1);
+#endif
+}
+
+int
+qt_writeframe(void *data, int datasize)
+{
+#ifdef HAVE_LIBQUICKTIME
+    int row;
+    /* QuickTime library expects an array of pointers to image rows. */
+    for (row = 0; row < qt_height; row++)
+        qt_row_pointers[row] = data + row * qt_row_size;
+    return quicktime_encode_video(qt_fd, qt_row_pointers, 0);
+#else
+    return -1;
+#endif
+}
+
+int
+qt_writesound(void *data, int size)
+{
+#ifdef HAVE_LIBQUICKTIME
+        return quicktime_write_audio(qt_fd, data, size / qt_sample_size, 0);
+#else
+    return -1;
+#endif
+}
+
+int
+qt_close(void)
+{
+#ifdef HAVE_LIBQUICKTIME
+    free (qt_row_pointers);
+    return quicktime_close(qt_fd);
+#else
+    return -1;
+#endif
+}
diff -u --recursive --new-file xawtv-3.24/src/writeqt.h xawtv-3.24-quicktime/src/writeqt.h
--- xawtv-3.24/src/writeqt.h	Thu Jan  1 01:00:00 1970
+++ xawtv-3.24-quicktime/src/writeqt.h	Sun Nov 26 09:48:47 2000
@@ -0,0 +1,11 @@
+#ifndef WRITEQT_H
+#define WRITEQT_H 1
+
+#include "video.h"
+
+int qt_open(char *filename, struct MOVIE_PARAMS *par);
+int qt_writeframe(void *data, int datasize);
+int qt_writesound(void *data, int size);
+int qt_close(void);
+
+#endif
diff -u --recursive --new-file xawtv-3.24/xawtv.spec xawtv-3.24-quicktime/xawtv.spec
--- xawtv-3.24/xawtv.spec	Fri Nov 17 22:58:44 2000
+++ xawtv-3.24-quicktime/xawtv.spec	Tue Nov 28 17:54:04 2000
@@ -8,7 +8,7 @@
 
 Summary: Video4Linux Stream Capture Viewer
 Name: xawtv
-Version: 3.24
+Version: quicktime
 Release: 1
 Source0: xawtv_%{version}.tar.gz
 Group: X11/Applications
