--- configure_orig	2009-09-18 13:52:31.000000000 +0200
+++ configure	2009-09-18 14:15:30.000000000 +0200
@@ -7176,7 +7176,7 @@
 
 
 echocheck "x264"
-if test "$_x264" = auto ; then
+if test "$_x264" = auto || test "$_x264" = yes || test "_x264_lavc" = auto || test "$_x264_lavc" = yes ; then
   cat > $TMPC << EOF
 #include <inttypes.h>
 #include <x264.h>
@@ -7185,18 +7185,43 @@
 #endif
 int main(void) { x264_encoder_open((void*)0); return 0; }
 EOF
-  _x264=no
+  _x264_tmp=no
+  _x264_lavc_tmp=no
   for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
-    cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264_tmp=yes && break
+    cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264_tmp=yes && _x264_lavc_tmp=yes && break
   done
+  if test "$_x264" = auto ; then
+	if test "$_x264_tmp" = yes ; then
+		_x264=yes
+	else
+		_x264=no
+	fi
+  else
+	if test "$_x264_tmp" = no ; then
+		die "x264 test failed"
+	fi
+  fi
+  if test "$_x264_lavc" = auto ; then
+	if test "$_x264_lavc_tmp" = yes ; then
+		_x264_lavc=yes
+	else
+		_x264_lavc=no
+	fi
+  else
+	if test "$_x264_lavc_tmp" = no ; then
+		die "x264_lavc test failed"
+	fi
+  fi
+fi
 
 if test "$_x264" = yes ; then
   def_x264='#define CONFIG_X264 1'
+  libs_mplayer="$libs_mplayer $_ld_x264"
   _codecmodules="x264 $_codecmodules"
   test "$_x264_lavc" = auto && _x264_lavc=yes
   if test "$_x264_lavc" = yes ; then
     def_x264_lavc='#define CONFIG_LIBX264 1'
-    libs_mplayer="$libs_mplayer $_ld_x264"
+    libs_mencoder="$libs_mencoder $_ld_x264"
     _libavencoders="$_libavencoders LIBX264_ENCODER"
   fi
 else
